Good question.
First, we have to remember that kids are more likely to be taken/harmed by people they know, esp. upset parents who have lost custody, etc.
Then, we teach our children 'what to do'. My son and I do review before we go out to large crowded places like the zoo: "Let's say you are looking at the lions, and when you turn around, you don't see me? What would you do?" He knows to 'be a tree' (not go anywhere), to ask a mommy or daddy (someone with young children) for a Zoo Worker (someone with a green nametag) and then to Stay at the Zoo, that the Zoo Worker won't take them away from the zoo.
He also knows to yell and scream if someone he doesn't know grabs him or tries to take him anywhere. He knows to "wiggle really hard" and run away and yell.
I think it's important not to scare kids about strangers, but that they know that good strangers will not ask kids to go away from mom or dad or come with them. The 'good strangers' know that kids should stay with their parents, and if they want to show you something, they should ask the mom or dad first.
For toddlers/preschoolers which run off: they have to stay contained in some way. My son knows that if he doesn't stay with me at the store, he HAS TO ride in the cart for the rest of the time. Or he has to hold my hand for the rest of the time. Not fun? Too bad. I think having a 'containment option' at the zoo (a stroller with buckles) or other busy places is a savvy choice for parents.
That, and we have to limit our own distractions. After years of nannying and watching other people's kids like a hawk, I've found two things to be key: consistent discipline for running off an to position myself to be able to see all of the children. Giving clear boundaries, telling them the places that they 'need to ask' to go to (esp. at some parks, where the play structures and swings are far apart) and establishing clear limits really has helped me.