Simple answer: don't go places that lead to stimming like this and/or meltdowns. (Instead of going to a restaurant, get take out and have a picnic in the backyard.) More complex answer: let them get their 'wiggles' out in the parking lot and make sure they have a quieter stim (ipad, sensory toy, music/headphones, coloring materials, books, etc.) option for inside the store, restaurant, etc. Another very obvious move that some people miss is to just try going at different times of the day when a place isn't as busy (my daughter loves to go to Montana's so we take her once every 2-3 weeks in the afternoon on a weekday - man there have been some tantrums over not going this month!), or try a different store/restaurant - it could be something particular about that place that's causing them grief (the lights at Walmart).
In terms of things like public events/activities you have to be sensible. Allowing Abbie to go snorkeling after the boat attendants told A&P that Abbie shouldn't go is frankly shameful. It was hugely disrespectful to Abbie and everyone else on that boat. There's no excuse. You can certainly try to take your kid to public events, you never know when they might like it, but it's up to you how to manage loud or attention getting stims. If I'm somewhere with my daughter and she starts cawing (yes, like a crow - no I don't know, either) I take her out to the parking lot and try to redirect it (giving her a chewie or some gum sometimes works). If that doesn't work we go home. I don't want people staring at her like a sideshow and I don't want to ruin their meal (or whatever), either.
For places that they have to go, like the doctor's, PT, ER, etc. there's usually a quiet room you can wait in - you just have to know to ask for it.