Can I use a Nikon 50mm f/2 pre-AI on my Nikon D5100? Will it cause any damage to my camera?
Yes, you're okay on an D5100. Higher-level Nikon bodies (like the D7000) can be damaged when used with pre-1977 lenses, but the D5100 and other bodies with electronic-only coupling will work fine with pretty much any Nikon-mount lens ever.
The D7000 and up have a tab used for metering with the newer lenses, and aren't safe — but that same tab means that you can get proper metering when using newer 20th century lenses.
See http://www.aiconversions.com/compatibilitytable.htm for more; that site also offers conversions so the lenses will work on higher-end bodies, and while the prices look pretty reasonable I've never used them so I can't make an endorsement.