im not gonna go into depth to talk about how theres different dogs (not dog breeds, dogs), and more importantly different dog owners, i think its pretty common sense these days to not generalize anything in any category.
i dont know why you seem to keep running into apparently rabid dogs that just come at strangers to ATTACK, but i have never encountered such. i have encountered overly friendly and not well trained dogs that come at me and stand up to try to paw at my torso, which is admittedly very annoying, and ripped my $800 jacket once, but i dont see that as harmful. what i do see as harmful is the fact that a lot of owners with no ability to reliably recall their dogs still let them wander around loose, just because THEY think their dogs wont be aggressive, and then our dogs end up fighting, and usually their dog gets hurt, and they blame my dog, a german shepherd, because, well, usually they are small dog owners, they think their tiny dog cannot hurt anybody, so if anything happens, its always the big dog’s fault. but what they dont realize is that because they dont train their dogs, the dogs tend to be aggressive towards other dogs, cuz they think they are king of the hill or some shit. and big dogs, some have some patience, some have none, but even those with patience, if the owners dont call their dogs back, the big dogs definitely will not deal with that kinda aggressive provocative barking. so of course they gonna bite your head off. and they are seen as the aggressive one, such bullshit.
of course all of this can apply to big dogs as well, it applies to all dogs that have been been properly trained, i just personally seen more cases of untrained smaller dogs because the owners think they can handle them even if they act out, so they spoil them and let them do their thing.
anyway, went a bit off topic here, my point is, i dont think a gun is necessary for loose dogs even if they do come at you, chances are they are just friendly without boundaries, a swift kick is more than enough. i have never seen any dog be aggressive towards a human without any provocation. im not saying it cant happen, but unless they have rabies, i really cant imagine that happening.