First of all, “Sandboxes” as defined by Stu, that is: “any game that doesn’t suck” is a misnomer. What Stu is actually describing is “the antithesis of ‘railroad’”. I posit that it’s Railroady games that don’t exist. Only the players perception of railroad exists. Sometimes a bad GM plans an adventure a, b, c and forces players to go down that road a,b and c. That’s OBVIOUSLY perceived as a railroad. But sometimes a good GM plans exactly the same story a, b, c and riffs on it. The PCs still end up doing the scenes in that order, but they don’t PERCIVE that the GM is encouraging them that way. “Yay!” They say “that was not a railroad, therefore it was a cool ‘sandbox’”. But it wasn’t. In this regard, @stu is correct.
But there are actual sandbox games, in this regard Tappy is right. Stu cites Minecraft as an actual sandbox because it is procedural not scripted. An algorithm decides what resources there are and what creatures appear. In, say, Red Dead Redemption, people have decided where the treasure is and what the challenges are, and what order things need to be done in - a b and c.
But there are proceedural RPGs indeed it might be said that early D&D was proceedural, because of “Random encounter” tables. Some people today hate random encounter tables, arguing that they dwork against immersion in the story. But some game designers work with and develop random tables to make something that build worlds nd creates narrative. Forbidden Lands is an example of this, it has random encounters, random mondseter generators, random gu from, village and castle generators. It is possible for the GM, and the platters to just roll dice and “play to find out” the story. This is a sandbox game that exists it even says so on the box but there are others that do it to a greater or lesser extent, Blades in the Dark for example.