Favelas are misunderstood places, and some are perfectly safe to visit (such as Vidigal), or with a guide, such as Rocinha. That being said, most favelas are not tourist-friendly and are best avoided.