That is remarkably not the case in the European Union. There is no exception to GDPR with respect to public places. The only legal basis for using public personal data without consent is to do it under legitimate interest basis (GDPR article 6, very specific exceptions exist). In that case, you must use the public data in a way that the data subject would reasonably expect (GDPR recital 47). Taking a picture of somebody in a public place and sharing it without them knowing is definitely unlawful, assuming free consent was not given.
That’s not how it works at all lmao. I recommend you read article 4 point 1 of GDPR (and point 2 for good measure). It really is enlightening!