Golfers can't tee up their ball on a hole ahead of the tee markers from the tees they're playing.
However, golfers often don't realize that the tee box is much larger than that space between the tee markers on the hole they're playing.
What is the size of a tee box in golf where a golfer can tee up their ball?
In golf, the size of the tee box is an imaginary rectangle. The width of the tee box is the space between the two tee markers. You can't tee the ball in front of them, and you can't tee the ball up outside of them.
The depth of the rectangle is created by taking two full clublengths (up to the longest club in the bag, which is almost always driver) from behind the tee marker.
Use both of those points twice to frame the rectangle, and that is the size of the tee box.
Of course, this means that the tee box isn't the same size on every hole, from every set of tee markers. The width of the tee box isn't prescribed in the Rules of Golf, meaning it can be quite narrow. However, golf courses typically offer generous tee boxes.
The Rules of Golf don't prohibit a golfer from standing outside tee box. Only the ball has to be in it.
All of this is covered under Rule 11 of the current Rules of Golf. The space is created so a golfer can feel comfortable hitting a tee shot on a space where there could be plenty of damaged turf, particularly on a par 3. The real estate created by the imaginary rectangle on the teeing ground behind the tee markers gives plenty of space to confidently tee up the ball and also have the space to hit the desired tee shot shape.
While there's generous room for the tee box, there's a severe penalty for teeing the ball up outside of the tee box. The penalty is two strokes and then needing to play a ball from what's officially dubbed the teeing ground.