No, Johannesburg is one of the least safe if not the most unsafe city in South Africa. Cape Town has a much worse gang side but the gangs stay in their area, if you stay out of those areas you should be fine (it's not easy to accidentally wonder into gang run areas).