back in 1858...Sheffield Rules.....A ball in touch is dead, consequently the side that touches it down must bring it to the edge of the touch and throw it straight out from touch.....
Yes, the throw-in went to the first team to touch the ball once it was out of play: which is why (over a century after the Law was changed) we still refer to "touch" and "touch-lines". A similar "first to touch the ball" situation happened if the ball crossed the goal line (but not a goal). If the defender touched it first, they got a kick in, similar to a goal kick. If an attacker touched the dead ball, they brought it 15 yards out and had a kick at goal (with defenders standing behind goal line.). Interestingly, when the Association and Rugby codes split apart in 1863, both kept this arrangement. Soccer soon dropped it, and after some fiddling around with alternatives, ended up with the goal kick or corner arrangement we have today (largely borrowed from Sheffield rules). Rugby however kept the idea of touching the ball behind the line to win "a try" at goal. The touch down scored nothing, unless the goal was then scored. Thirty years later they started to give points for both "try" and goal.