I have used WD-40 a few times inside the tubes when I ran out of Framesaver. It definitely works, but it might be thinner and less long-lasting than something like Framesaver but I don't store my bike outside or ride constantly in the rain so I'm not too worried regardless.
I spray it in there before installing the headset or bottom bracket so I don't dissolve any grease.
I have also been using WD-40 to wipe down my frames recently. I have seen claims that it protects paint and also that you shouldn't leave it sitting on paint for too long. I have sprayed it on frame tubes and then wiped with a clean rag and the paint seems to be fine. It gives the bike a nice shine but attracts dust a little easier when you're riding.