I was taken out by a big rottweiler in October. He had a full head of steam and caught me by surprise. Not mean, but thrilled at the chance to chase something. Both knees scraped good, took a couple of weeks before I could kneel again. Fortunately, the owner came out as I struggled to my feet. She now has a new understanding of pet ownership, I "discussed" the actions I had available to me and her responsibilities. Haven't seen those dogs loose since.
I now carry pepper spray. And if I see I'm not going to outrun the dog, I stop.
My old steel frame Peugeot survived, but my rear rack took the blow and saved my spokes.
What about carrying an extending metal baton? I'm thinking if you had a three to five foot reach, you could really discourage a dog. Either that or a bull whip.