Often children at this age (and many other ages too!) test the parents' limit setting capacity. I recommend you set clear limits for behavior in public places.
1. have very clear consequences for crossing a limit
2. make the consequences simple and manageable for yourself
3. make sure you follow through if you say there will be a consequence.
Your consistency and predictability can go a long way in helping to curb your son's behavior issue.
Another suggestion: you might provide some simple, non-expensive, rewards, such as a favorite treat or some extra attention, for your son exhibiting the behavior you want from him. You do not give much detail in your question, but it is a possibility that your son's oppositional behavior is a bid for your attention. If you think that might be the case, the idea would be to remove your attention when he behaves badly. For example, you would tell him that he is "making a poor choice" and that if he wants to continue in the public place he will have to "make a better choice."
If he pulls it together, (regulates himself) you might then reward the corrected behavior with some attention. For example, if he re-regulates himself when you cue him, then you might simply engage in a discussion with him about something he is interested in. You don't necessarily have to announce, "I am going to give you attention now, because you behaved," because sometimes just giving the attention close to the corrected behavior sends an intuitive message. How he behaves over time as you apply these strategies will clue you as to whether you are on the right track.
Also, when he re-regulates, refrain from too much praise. Something simple such as "you made a better choice," or "I am happy to see that you made a good choice," can do the job.
If he cannot regulate himself, you might have to leave the public scene. In such a case, if he has a meltdown, as long as he is safe, you may have to use "planned ignoring," so as not to give attention to more poor behavior. If you cannot leave the public place, your best plan (assuming he and others around him are safe) is to ignore his behavior and do your best to ignore stares of others. It is no one else's business. But it is essential in this type of circumstance that safety needs are met.
When you are not in public, you might want to talk to your son and try explaining to him that you are no longer going to tolerate negative behavior and that there will be consequences if he misbehaves. If you live with his father or a partner who is involved in parenting, you might want to discuss this with that person and come up with consequences that you both are comfortable and willing to institute and back up.
In addition, I recommend talking with your son's teacher to see if he exhibits this behavior at school. If he does not, then you have good reason to believe that he is capable of following what you tell him to do. If the problems also exist at school then it would be wise to work out a behavior plan with the teacher that you can adapt to home and public. Rule of thumb: the more everyone who deals with a child is using similar techniques, the better chance of success.
If all these steps fail, you may want to get some support and ideas from the school guidance counselor or an outside professional. Occasionally this type of oppositional behavior can indicate other problems that need to be addressed by counseling.
I hope this helps. Let us know how you do with these suggestions.