Thank you for that information. Dogs go through certain imprints during their life and one of them is fear. They have that first fear imprint is in 8 to 11 weeks and then again at 6 to 14 months. During the second stage of fear imprints you are likely to see the dog be scared of something that they were not scared of before, and because you did not have the dog during the first fear imprint stage you won't know what happened to him in that stage that may be affecting him now as well.
Dogs are also born with personality just as humans are , sometimes we as the owner can mold that personality only to a certain extent. Much will also be dependent on where the puppy was born. If it was a puppy mill , then the dog never had real contact with people through the neonatal months and thus will be fearful of people maybe for life. Sometimes you can help the dog adapt but for some dogs they will only be comfortable with certain people in their lives.
You mentioned he sometimes has fear of hats, this could be from the family that had him during his first fear imprint which he has carried over. When a dog is brought back to a rescue and the reason is due to the dog being too much fir them, then you have to ask yourself what that family expected from the dog and if the dog was not listening what did they do to try to get it to listen? Unfortunately many people still believe in the old method of training which is punishment for everything the dog does and most people adopt a dog around 7 to 8 weeks ,during fear imprint period.
Dogs also react not to just items people wear, but also their body language and tone of voice. If the first home what did all of that look like to such a young dog with lots of personality?
So that would be the explanation as to why you are seeing what you are seeing. What to do with to help it can be tricky because our human instinct is to love and coddle anything that is frightened or hurt which is the wrong thing to do as it can be seen as a reward for acting that way. The more the dog is coddled and soft talked during fear the more it will act that way as it is being rewarded for acting like this and so the worse the behavior gets.
When it comes to people the best bet is for people to ignore the dog, no touching or reaching out to pet, no eye contact, not talking to as all of these are seen as challenges to a dog. A dog that is perfectly happy and stable is not going to perceive these actions as a threat unless something happens to it. On the other hand. dogs that already have that fearful personality will see it as big threat and will try to get away, if they can't get away they may eventually bite. People who the dog does not see as a threat will act fine with them. This of course is until the person acts, speaks, or wears something that was kept in the dogs mind during those imprint months.
I would have people just drop a piece of hot dog and walk away without ever looking at , talking to, or trying to pet the dog.
Over time the doe will begin to see that people are not out to harm it and they actually leave behind something good. To do this you will need to have friends help you as they can take direction from you unless you feel confident in going up to strangers and giving them direction, but they cannot try to deviate in any way and impose their own ideas of what should be done or you can be setting the dog up for failure.
Gradually as the dog becomes more sure of itself you can increase one threshold at a time and I would start with them just saying the dogs name. dropping the treat and walking away. then I would call the dogs name, look at it, drop the treat and walk away. The very last would be petting and that can only come when you see the dog is looking forward to seeing people.
Make sure for every good reaction the dog gives that you also praise and reward the dog. If you are clicker training then click and treat. The clicker is great because it takes the human tone out of the equation.