If you are interested in this topic, especially from the US perspective, I recommend this book: https://www.alibris.com/Hatless-Jack-The-President-the-Fedor... . There was apparently significant social pressure for all men to wear hats until the mid C 20th.