Every city has its own selection of problems, and every location within a city has some form of hazard. The nature of hazards varies enormously and may include such problems as missing drain covers, building work, pickpockets, muggers and irate people who do not wish to be photographed.
An experienced photographer eventually learns not cope with all such situations - and many more. It is certainly better in all cases to avoid the situation in the first place rather than trying to escape the consequences once something has happened. It is important to develop a feel for streets where particular risks exist, and to decide at an early stage what action to take. You might decide to turn around and go elsewhere, or keep your camera out of sight and walk as quickly and purposefully as possible. Where risks are all too apparent, do not work alone. Two people are less likely to run in to problems.
In general, do not carry unnecessary equipment and keep what you do carry out of sight as much as possible. Don't carry lots of cash and numerous credit cards - take just what is needed for the day. A simple plastic bag bearing the name of a local supermarket is a useful item. It can be used to protect camera gear from the rain, and to carry a camera and lens in an area where you feel vulnerable to muggers. Dress down and try to blend in with the crowd as much as possible. Don't wear an expensive watch or flash the latest the latest thing in mobile phones.