That is a good reason why it's often advised to carry good pepper spray even if you have a CCW permit. Try the pepper spray first, but be ready to back it up with necessary. If the pepper spray doesn't work it shows that you tried a less lethal method first.
I carry a shambok that's about a yard long. If it can kill snakes it should be able to fend off a dogs (at least small ones).
Do they make any of those clip thingamajigs so you can attach your pepper spray under the barrel of your CCW piece?
Just kidding.
From a legal defense standpoint, it's actually not a bad idea for CCW situations outside the home. Inside, I'm not so sure...
My dogs got into a nasty fight with each other a few weeks ago. I tried pepper spray and it didn't even slow them down.
I had to hit one with a broom handle several times before he even realized he was hit. That dog adrenline keeps them going.
And yes, I am working with them, training wise. They are just two big males from the same litter, and each wants to be top dog.