Brazil is a touristic friendly country, but like in many other countries in South America, it is better to be safe than sorry. The next advice is based on my own experiences in the country back in 2011.
"If you want to move freely on the streets in Brazil, you should dress down and don’t show off any valuables. Don’t show any expensive cameras, phones or jewellery"
"If you really want to visit a favela and see how locals live there, my advice is to go with someone who know the place well. Avoid walking in a favela on your own, especially at night".
Things to Avoid page 82 in latest book about Visiting Brazil
Another thing to bear in mind is that Brazilians are very casual and don’t wear anything that looks too expensive. They prefer to wear shorts and flip- flops (Havaianas) rather than fancy clothes. If you’re wearing anything that stands out like a Louis Vuitton handbag or even make up, if you’re a woman, be prepared to be noticed and be targeted by hagglers, or worse.
Of course, it depends on where in Brazil you go. São Paulo is the most urbane and business-like city, therefore this is where you will find all the expensive outlets and a less casual style.
You can read more information about keeping safe in Brazil