In the ten plus years I walked my unleashed heelers through the neighborhood or ran them next to my bike (these dogs stuck so close leashes were redundant) I had occasion to use bear spray eight times. IIRC four pits, two rottweilers, a boxer and a big yellow mutt.
Of course we were charged by loose dogs much more than that, most times I was able to bluff them off by yelling and posture. Many dogs too recognise and fear the motion of picking up a rock to throw.
On the occasions I had to use it the 20-30 ft blast of bear spray turned 'em around every time tho most times I missed, shot too low, in those cases just the blast would startle the dog from fight to flight.
I shot low because of the vertical nature of the bear spray can relative to the perpendicular nozzle, sorta like a handgun would with a 90 degree angle between grip and barrel (like the old Tokarevs), aim above the dog's back to hit it in the face.
The only drawback to bear spray was the cost, I replaced it each time even if I didn't use all six seconds of it, $50 a can.
I dunno if wasp spray would work as well, prob'ly would.