And if a sandbox allows for linear play any any point….do we need the term sandbox?
Yes, because you often have the opposite: linear play without the freedom to roam.
Complete sandbox:
DM:
"Ok everyone, here's the map of the world. Where do you want to start? (players answer)
The city of Freehold? Ok. This is what the city is like. What do you want to do there? (players ask questions about the city)
Sure, the queen is organizing a festival for the Tradespeople due to an upcoming holiday, you can certainly go to the party!"
At which point the scenario is set, the DM rolls some encounters, improvs an adventure, etc. The world is there for the PCs to explore. If what the DM tells them doesn't sound interesting, they can tell the DM where they want to go to find out what might be happening elsewhere.
The players have (pretty much) complete agency. While they don't decide what is going on in the world when they get someplace, they are totally free to act to events however they wish or ignore them entirely.
"Common" sandbox:
DM:
"Ok, you guys are starting in the city of Freehold. A lot is going on as there is an important festival coming up! You've heard the city watch is looking for extra help to keep the peace during the festivities. Also, a promenent merchant needs some goods brought from a nearby port but he's concerned about bandits along the way, so he's looking to hire. Oh, oh, and
there's a royal ball at the castle... could be fun if you could get invitations. Any of that sound interesting? Huh?"
At which point the players decide together which "hook" sounds most fun to play and the DM moves things along as they do that particular adventure. Depending on how it goes, the other hooks might still be viable or might not, new ones come up, or the players might say, "Hey, let's head to the port now and see what ships are sailing where!"
The players have agency in making decisions given the limited choices. Often, if none of the options sound appealing, the DM will "wing-it" until something happens that the players are interest in and build an adventure based on it.
Non-sandbox (aka the railroad) or Linear:
DM: "
So, you're in the city of Freehold heading to the Watch Command because they need help for the upcoming festival in honor of the city's tradespeople. When you arrive, the guard doesn't seem keen to let you in. What do you want to do?"
Now, the party is directly set on the adventure path the DM wants to run. If the players try to deviate too far, the DM will force them via encounters or whatever to "get back on track" -- hence why it is called a "railroad".
The players have no real agency other than what they do at a particular moment in the adventure.
Of course, as others have said its a spectrum between the extremes. My own games run somewhere between Common Sandbox and Railroad, ebbing and flowing more towards one or the other at different times. I've run games which were complete sandboxes, but players have to have a lot of buy-in and interest in the game world for those to work well on any level IME.