Unscrew the bolts holding the top of the gearbox where the selector mechanism goes, lever the main gear back into place with a long screwdriver, and then use the screwdriver to tap the mainshaft nut around until it's reasonably tight again. Then drive it home where you can fix it properly.
No, that would happen if the clutch cable snapped though. I've had this happen on a Vauxhall Astra and a VW Polo (that was actually a hydraulic pipe failing).
No biggie. Just knock it into neutral, brake to a stop, and figure out what to do after that.
Both times once I got it stopped, determined that nothing really bad was happening, and that it was safe-ish to proceed, I just put it in 1st, started it up, and went up through the gears carefully without using the now no longer disengageable clutch until I got home and could look at it properly.
Even when the vehicle is moving and in gear, there's very little actually holding it in gear. Inside the gearbox you've got two shafts, one driven by the engine with geared teeth on it, which meshes with gears that spin freely on bearings on the output shaft. The gears work in pairs, with a brass collar that slides backwards and forwards to lock the spinning gear to the output shaft.
When you put it in first, the brass collar locks the biggest output gear to the shaft, which is driven by the smallest input gear, so you've got a big reduction, and so on - look at the derailleur on your bike, it's the same idea.
There's a semicircular fork that slides on a rod and that rod has notches cut in it, that a ball bearing on a spring clicks into. When you put the gearbox into gear, the click you feel is it jumping into that notch.
But that notch and that pea-sized ball bearing is all that holds it in place!
So you can lift off the throttle a little so the gearbox isn't under tension, push gently on the shaft, and it'll pop into neutral.
If you start it in first gear, you can get some speed up, pop it into neutral, and then if you carefully get the right amount of revs, you can just pop it into second. I don't recommend trying this in a car you plan to keep for a long time, it wears the gearbox quite heavily, but you will be able to do this - with some horrible noises the first few times until you get used to it - and keep your starting and stopping and changing gear to a minimum all the way home, or to a garage.
So now if your clutch cable breaks, you know you can actually get out of the snowstorm and home, or at least somewhere safer.
A manual car is normally in gear while you're driving it. Being jammed in a gear, while catastrophic for your goal of getting to your destination, wouldn't be terrifying like an uncommanded acceleration.
If you were stuck in a certain gear you couldn't shift down to go much slower without stalling (but you can let it stall, if you were trying to stop anyway. You wouldn't be the first car to break down on the highway) and you couldn't shift up to go much faster (but in an emergency you could still floor the accelerator, wasting gas and wearing out your engine much faster).
Unscrew the bolts holding the top of the gearbox where the selector mechanism goes, lever the main gear back into place with a long screwdriver, and then use the screwdriver to tap the mainshaft nut around until it's reasonably tight again. Then drive it home where you can fix it properly.
At least, that's what I did.