With my dog, who is mostly a butthead but slowly getting better, whenever we would get near other dogs when walking, I would pull him close to my side and keep walking straight, telling him to leave it as we went past. He has gotten to where he is much better on a leash, especially if we move off to the side or walk past unreacting dogs.
Public places with lots of people and dogs are chaotic. I will admit that I brought my pup with me and my golden (who is 100% safe with other dogs and people), with the goal in mind of praising him and rewarding him for simply staying quiet and observing other dogs. He actually did very well in the end, and was being very polite and calm. More of the issue was with people who weren't paying attention to their dogs or simply didn't seem to care that their dog was getting into other dog's or people's spaces.
I had one gentleman who looked offended when I told him that my puppy can be unpredictable at times with other dogs to warn him to reel his little italian grayhound in. I was sitting on the bumper of our ambulance and Doyle was laying down between my legs and under where I was sitting. I had both hands on his collar with my attention on both the dogs. He was a perfect boy, merely laying there until they left. He has been steadily getting better since he knows what I want from him. With new dogs, he is supposed to ignore them. If they happen to be in the group with us, he has to stay on task and leave them alone. It has worked for me in his case lol.
Just today he met a dog for the first time I know he never did and he wanted to PLAY with her when she came up!
It's the first time I've ever seen him try to initiate play with a strange dog he just met. He isn't 100% perfect, but he gets very clear reward for what is wanted, and clear punishment when it isn't. He's hard to distract when he gets to a certain level, and he has a rather hard head lol. But he wants the reward more (generally getting to go play with his doggie friends and packmates) and his recall has gotten much sharper when we're out.
Took my golden til when he was 3 to suddenly seem to grow up and get everything I'd been trying to teach him. Dogs lol. Can't wait for the obnoxious stage to be over with!