What you can or cannot do as a photographer in a public place is a confusing minefield. Countries and cities have different laws governing your rights as a photographer and not knowing where you stand can land you in trouble. Ignorance of the law is no excuse, so the onus is on you to make sure you are legal.
As a former police officer based in London, I'll only deal with the laws of England and Wales.
Photographing in public places
Members of the public do not need a permit to film or photograph in public places, and the police have no power to stop them filming or photographing. However, you must obtain written authorisation from the Mayor to take photographs in Trafalgar Square or Parliament Square Gardens if you are doing so for a trade, business, profession or employment.
There is nothing to stop you photographing incidents in public places, police personnel or members of the armed forces unless you are doing so for the purposes of terrorism or to aid terrorists. Under section 43 of the Terrorism Act 2000, police officers only have the power to stop and search a person who they reasonably suspect to be a terrorist. There is, however, nothing stopping police officers from asking questions of anyone taking photographs of police officers and military personnel but this must be done for a lawful purpose and must not hinder the photographer from doing something which is not unlawful.
The police do not have the right to search you or your camera unless they have reasonable ground for suspecting that you are in possession of articles unlawfully obtained.
Unless you are doing something which is covered by the above, you can photograph any subject in a public place. You don't need to obtain permission from your subject and you are the copyright holder of all your images. No one can prevent you, or ask you to move from any public place when taking photographs.
Photographing on private premises
Knowing the difference between a public or a private place can be a little confusing at times. Different Acts of Parliament define public places differently but as a whole a public place is any place to which the public have access. While places such as shopping centres and tourist attractions are open to the public, they are privately owned. You should ask for permission before taking any photographs.
It gets a little tricky in the street. Buildings are obviously privately owned, but their land often extends beyond the building line. Don't be surprised if some over-zealous security guard asks you to move on or stop what you are doing if you are close to an office block or similar. Bollards around the building or even metal studs in the pavement are a good indication of where the private land becomes public.
Obviously, photographing from a public place into a private one is a big no-no.
Where does this leave you?
You can take a photograph of anyone in any public place, irrespective of their age or gender (see the comment below about children). Unless you intend to use images of people and some buildings for commercial purposes, you do not need a model release and can publish any photograph without the subject's permission.
You need authorisation to take photographs in a private place, no matter what the reason. You also need permission from the Mayor's Office to take photographs in Trafalgar Square or Parliament Square Gardens for commercial purposes.
You own any photograph you take. No one, including members of the public, security guards or police officers, can make you delete an image or attempt to take your camera against your will. Doing so could consitute a criminal offence.
While there is no legal reason why you should not photograph a child in a public place, note that you might have to face a disgruntled parent. Be etremely sensitive when photographing other people's children. After all, how would you feel if a complete stranger started to photograph your child? In addition, if you intend to publish any photograph that has children as the subject on a social media or photography sharing site, I would be very careful about revealing anything about the child's identity or even where the image was taken. There are some very unsavoury people out there who troll the internet and they could use your images to target a child.
Look after number one
It goes without saying that your personal safety is paramount. Be aware of where you are and who is around you. Unsurprisingly, you will know your rights as a photogrpaher better than anyone else, including police officers. If you are challenged by anyone, be polite and non-confrontational but don't be afraid to stand up for your rights. Don't make a nuisance of yourself by obstructing a public place, an entrance to any place or following anyone.
You have the right to take a photograph of anyone in a public place, so get out there and have fun.
Disclaimer: I am not a legal professional and nothing in this article constitutes legal advice. If in doubt, check with a local lawyer.