Hello from Argentina! I have been to both...São Paulo in my opinion has the better nightlife of the two and Paulistanos (people of São Paulo) are to me hotter then Rio. There is also to consider there are better places to eat in SP and shopping is amazing (you can´t do this as freely in Rio due to crime). You also have near by Santos; which is about an hours drive from SP; which has beautiful beaches. Some places of mention near SP to check out São Sebastião, Toque Toque Grande, Maresias (beautiful). SP is more cosmo and has a larger gay community then that of Rio.
Rio is beautiful visually and the beach life is amazing, I found safety to more an issue here then SP as it´s surrounding by villas, you need to be more careful at night, watch your drinks and who you take up to room if your hotel allows it. But if your after the beach for your trip then I would hit up Rio, the scene is a little more mixed and most of the gay guys hang out near Ipanema, I didn´t find the nightlife very interesting in Rio due to the fact I´m Buenos Aires and they just can´t compete ;). SP does give us a good run. But the scenery is amazing.
NOTHING as ever happened to me in Rio, just use common sense. When I go I leave my nice watch and phone at home and take one I don´t care if it gets stolen or broken during my trip, and after that all you need is a nice body, smile, and speed to enjoy Rio!
If your able to do both I highly recommend it!!
I hope you enjoy your trip!!!