My kids just turned 3 and 2. They don't tantrum as much as they used to but they have their moments. If a tantrum occurs at someone's house, I exuse us from the room and go to a quiet place for timeout. I try to talk them out of the tantrum and if it doesn't work I let them work it out on their own.
Our public outings mostly consist of shopping trips and I use a variety of tactics to limit tantrums in stores. None of them work all the time, but I've had pretty good success. First, I try not to take them shopping just before nap time or meal time. That spells disaster for us. I do take along a snack and sippy cup. If I can sense that a tantrum is coming (maybe we are headed to the toy section or they are picking on each other) I pull out the snacks and drinks to keep them busy. Sometimes I ask them to help me by holding items I am buying. I also ask them to help me find certain items I am looking for. Sometimes I sing and distract them so they won't be interested in the things around them. Talking or singing in funny voices and having them repeat it often works. With my older child, sometimes I will let him hold something he has asked for while I am looking/comparing other items. I tell him he can hold it and look at it while he sings "Happy Birthday" then we have to put it back because we aren't buying it today. With my younger child I sometimes take along the activity mat that wraps around the shopping cart handle bar. I always praise them and thank them when they are being well-behaved and tell them that listening to me in the store helps me get the shopping done.
On the occassions where these tactics haven't worked and a tantrum starts that we can't get under control I load them in the car and go home. While some people have told me that in those instances I am letting the kids control what I do, I counter by saying that I am doing what I feel is best for all of us. I am stopping the tantrum, lowering my stress and decreasing my child's frustration. I am also considering the fact that maybe my kids are having a bad day, aren't feeling well, or are over stimulated, so if I can get them to a happier place then I do it. These occassions aren't often (maybe once every couple months) so I don't feel as though I am letting the kids call all the shots and I don't think they have come to expect that either. I'm just trying to be reasonable and respect their needs.
I hope something here will be useful to you. Good luck!