If your dog can't break its attention from another dog to you there can be several reasons, your too close to the other dog, timing, your watch me isn't as strong as it needs to be, your treat/reward isn't high value enough. Distance is key, if you haven't already, you need to have some rough feel for how close a dog can be and your dog to stay calm. Then you need to do your best to keep that distance. Once your dog is reacting to its trigger it's too late to try and train your way out of that situation. Your dog isn't in a receptive emotional state to be trained.
Watch me is also important, if you haven't worked on him focusing on you with no distractions, then adding low level distractions and increasing this until you can actually try this when a dog is involved, it won't work. Use other triggers that are not as intense, such as birds, cats, humans, to build on and instill the behavior you want to use when other dogs are around.
Treats/rewards are going to need to be high value, which for most dogs means meat, smelly, tasty, special are all traits of a good treat. You are going to need to experiment a bit to see what works for your dog.
When your dog goes into its react mode, just do your best to get distance from whatever it was that set your dog off. Trying to get him to look at you, sit etc at this stage under this situation won't work. So, keep trying to keep a safe distance between your dog and other dogs, try and keep yourself between your dog and other dogs even just walking around. Work on watch me or some other means to have him focus on you in no distraction areas, then build on that by trying it in low distraction areas and eventually when other dogs are around.