First things first - Remember that any punishment (yelling, jerking the leash, grabbing the dog, etc.) adds to the dog's anxiety level. Most likely, the dog will try even harder to keep other dogs away to avoid such trauma.
Here are some steps that can improve the quality of your walks:
1- Work on getting his attention before you go out. Say his name and reward him for looking at you. Start in a low-distraction environment (like your living room) and gradually move to busier areas, only continuing when you can get the dog's attention no matter what. You are teaching him to look at you comfortably regardless of the environment.
2- Start at a distance from any dogs: wait until your dog notices them, and immediately get his attention and reward. Do not wait for him to react! You are teaching him to associate the presence of other dogs with something wonderful. When he looks up at you for more, go closer and repeat.
3 - If the dog barks and lunges at the dogs, you went too far too fast. Add more distance and repeat. DO NOT PUNISH FOR BARKING!
4- Manage the environment for everyone’s safety. Keep a comfortable distance from other dogs, don’t allow others to greet (at this time), and don’t allow others to invade the space.
1.When you are lazy, avoid routes with dogs! If you aren’t going to be a good trainer, don’t allow your dog to react–and thus unravel all the work you are doing. (It’s like a smoker who picks up a cigarette again!) 2.Practice “Fido, look!” every chance you get, NOT just when faced with other dogs.