Seriously. I think this subject has really been hit with the "one bad apple spoils the bunch" philosophy. Yes, there are some bad apples out there who are out to prey on kids. Horrifying. But, there are SO MANY MORE good folks who are just trying to be friendly, chit-chat, even just acknowledge the existence of other humans they come into contact with throughout the day. Plus, I think that it's easy and common for kids to feel "ignored" by adults, and it's nice (or should be) when an adult actually takes the time to acknowledge and talk to kids, and kids get a chance to learn to interact with adults. It's sad that what should be considered normal human interaction so quickly gets thrown into the category of "suspect", in order to stay on the safe side.
(Anecdote: when I was a kid in the 80's, apparently "stranger danger" was a big subject and it had my mom freaked out. When I was about 3, she drilled into me so fiercely that I was NOT under ANY circumstances to talk to ANY strangers EVER, that one day we were at the grocery store, I was sitting in the grocery cart with my mom about 5ft away and an elderly gentleman came up and said to me "my, what a beautiful little girl you are", and I screamed at the top of my little lungs "YOU'RE A STRAAAAANGEEEERRR!!!! I CAN'T TALK TO YOU!!!". I remember being scared that I was going to get in trouble for this man talking to me, the poor man was shocked at my response and didn't know what to say. To hear my mom retell the story, he really was just a nice old man, not a creep. Sure, the fear my mom programmed into me kept me on the "safe side", but it also meant that a nice old man got screamed at by a 3 year old.)
I think the "safe side" includes listening to your gut, as other posters have mentioned, and also teaching kids (not scaring them) about appropriate and inappropriate conversations with strangers, so that they can start learning how to listen to their gut too. Personally, I don't want to live in (or teach my kids to live in) a "trust everybody" or "trust nobody" world - I think that undermines community, human connection and social intelligence.
It's tough because there's no "perfect" answer that will always keep everybody safe all the time, and also leave people open to connecting with all the "safe" people all the time. The best tool I have for navigating this stuff is my gut. It's been right 99% if not 100% of the time so far (except for that time when I was 3...). If anyone has a better idea, let me know!