If it's an aluminum rim you've just discovered that aluminum doesn't take paint well. To improve your chances of a result worth the effort you need to use an etching primer. If you're using a chromed steel rim I really haven't got anything to suggest apart from sanding the heck out of it.
Before you try again you obviously need to get rid of all the flaking paint, which would mean either a chemical stripper or sanding down to bare metal.
Assuming it is a metal rim you're talking about you can use whatever solvent you want w/o risk of hurting anything. You pretty much need to get way into serious acids before there's any risk for the rim.
Non-metal rim? Tell us!