There's a thing called Street Photography, where photographers take pictures of people and things on the public street. Street photographers actually talk about ethics: dostreetphotography.com/blog/law-and-ethics
I think there are ways you can take pictures with your phone in a way that's unobtrusive and not obvious. Practice in situations that aren't likely to get you in trouble. Or get a DSLR or mirrorless camera with a long lens so you can shoot from a distance.