We went with a group of friends, two of whom lived there and we all just followed them as they led us around. So we didn't have to be too aware of safety and muggings. They would not have put us in a bad situation. So I don't have much advice about that.
However, having grown up in New Orleans and witnessing many Mardi Gras celebrations, I was not all that photographically well prepared for the Rio version. In New Orleans the parades wend their way on the streets throughout the city, day and night. In Rio the parades take place at night at a venue called the Samba Drome. It is essentially a half mile long airstrip with bleachers lining one side, and a concrete three story building lining the other side.
Our friends got us seats in the front row of the bleachers, right at the side of the parade route, so the paraders passed within feet of us. We were at eye level. If you sit in the concrete buildings, you are raised up well above the level of the parade. While that might have some photographic advantages, I think our seats offered a better overall vantage point.
The Rio Carnivale is a Samba dance competition, with a couple of dozen "Samba Schools" or clubs, each of which has thousands of members, creating costumes and music especially for the night. It is way more extravagant than New Orleans.
There are two nights of parades to determine the dozen or so best clubs. Then the next week those clubs have a "Parade of Champions". It lasts all night, is very loud and you need ear plugs. We only saw the parade of champions.
You will be photographing at night, with lighting at the level of a pro football game, so you need fast lenses and high ISO cameras. If you could only take one lens, it would be a 70-200 2.8. A 200 f2 would be ideal for isolating individual dancers. A 24-70 2.8 should take care of the rest.
But most important, bring ear plugs!