It happens. I go to school for photojournalism, and for class assignments we are required to get the subjects name. So imagine not only having to get the shot, but having to approach the subject (or subjects) and ask their name. Needless to say, many are very sketched out and outright refuse, even after explaining what it is for and offering them use of the images. Nothing is worse than shooting a subject for 5-10 minutes, or more, getting some beautiful shots for an assignment, and being refused a name.
Anyway, I never really WORRY about it. If you are on public property, you are fully within your legal rights to photograph anyone else on public property. There may be some sticky legal issues dealing with Expectation of Privacy when engaged in grey areas of this practice such as shooting with telephotos from public property into windows, but that's never really interested me anyway! But I've definitely heard horror stories from people in class about irate people demanding the deletion of pictures (which they have no right to do, by the way). Technically, at least in the States, a photograph taken for personal or journalistic purposes falls under the category of freedom of speech.