You need to look at the fork axle-to-crown length, and the fork offset.
Fork offset is usually pretty constant around 45-50mm, and pretty much any new fork should be OK. Axle-to-crown length, on the other hand, varies from 390mm for a short-ish rigid fork to over 500mm for a longer travel suspension fork. As the name says, axle-to-crown is measured from where the wheel axle sits in the drop-out to the top of the fork crown where it sits in the bottom headset cup of the frame head tube.
Switching to a shorter fork will steepen the head angle and make the steering more responsive/twitcher. Switching to a longer fork (more likely if you're going rigid to suspension) will make the head angle slacker and make the steering more stable/less responsive.
I swapped the knackered old suspension fork on my 90s MTB for a rigid fork a little less than a year ago, going from an axle-to-crown distance of 455mm to 425mm. While the internet suggests this should make a significant, or at least perceptible, difference to the way the bike handles, I personally wasn't able to feel that much difference.
So from my experience I'd say if you can get a suitable fork with an axle-to-crown measurement within 30mm of the old one it's worth a go.
While I'd agree that a truly awful suspension fork is worse than a rigid one (that's why I made the switch on my old MTB after all!) I wouldnt' be too sneery about cheap-ish forks. I'd be happy to ride something costing £100 - but maybe not £30 new from
ebay. Then again old 90s elastomer forks still feel pretty good to me (as long as there's no slop and play in the bushings making them flex all over the place). FWIW I do ride a modern bike with rockshox rebas (I think) quite regularly too, I'm just not convinced the difference is that earth shattering.