Throw a meat treat in the direction of the oncoming dog, turn on your heels, and walk away. I cannot even count the number of dog owners who are shocked that as their dog is being harassed by the off-leash dog, the owner of stands there, saying nothing, and doesn’t help to put an end to the situation. If another person is walking with you, ask them to attempt to catch the oncoming dog as you leave the scene (you have to decide in an instant if that would be a safe maneuver or not because breaking up a dog fight is an excellent way to get bitten).
You want to reinforce behavior you like, such as when your dog looks at but does not react to another dog a good distance away. If you have to stop an incoming assault from an off-leash dog, you can yell “SIT!” at the oncoming dog (sometimes it works) and then throw your meat treat on the ground near that dog and do a quick, calm U-turn and move away. Could the dog have some sort of meat allergy? Possibly. That’s just one more reason the dog’s owner should obey the leash laws.
Please remember to remain calm at all times, and utilize jackpots (more treats or better treats) when your dog accomplishes something that was difficult for him; i.e. not pulling you toward the neighbor dog! Jackpot for any eye contact or focus on you! Keep leash training sessions short and FUN! You can train several times a day, but you don’t want to push you or your dog past the point of fun! Puppies, especially, have short attention spans and if you insist on puppy training past the point of fun, usually around 5 to 15 minutes, your pup may start to dislike, and even dread training!