I do sometimes carry a handgun while riding (Taraus PT-22
http://www.taurususa.com/gun-selecto...cfm?series=SF1 ). It is a double action only auto loader and totally safe to carry with a round chambered which facilitates one handed use. I would only use it was a last resort to remove a dog which had already attached itself to one of my legs.
Good pepper spray is highly effective and far less likely to draw attention that results in having a long chat with a police officer, filing a lengthily police report, explaining to a judge why you should not lose your carry permit ect... This would all be simplified in your favor if you were covered in dog bites.