
Generally, when people are located in public spaces, they have no expectation of privacy, so the photographer doesn’t violate their right of privacy when taking their photo in a public space.
While that’s generally true in the US, I hasten to add, however, that different states have passed their own laws regarding personal privacy, and the laws of other countries often are considerably different than the US, so you need to know the laws in your specific location.
The “rule of thumb” above, has to do with taking photographs, however, not using them.

After the photo is taken, new concerns of privacy come into play, and one’s person right of publicity. For example, generally, a photographer violates a person’s right of publicity when, without permission, the photographer uses a photo of a person for the photographer’s own benefit, sometimes referred to as “commercial” use as opposed to an “editorial” use. Like many concepts in law, this one isn’t precisely straightforward.