Dogs on a lease can also be an issue when trying to walk on narrow trails. Dogs can inflict a lot of damage and they even kill people now and then. Those of us who have been attacked a few times get nervous. Imagine being on the trail and seeing someone with a handgun. You might be nervous even if it was in a holster.
On a narrow trail it isn't the dogs fault it reflects on the owners lack of courtesy and ignorance of training the dog. When we are hiking and encounter others I instruct my dog to get to the side of the trail and sit until the others are past You state you've been attacked by a dog a few times. What exactly in your mind is a dog attack? Bitten or just rushed at?
Your statement about a gun makes me wonder if you're anti-gun otherwise why be nervous seeing it in a holster? If out of the holster get out of there if possible