Pages that link here:
The fez is a red short cylinder with a tassel on the top of it. It was popularized during Ottoman period, but still is an icon of Ottoman culture. Fez was used in the Middle East, Eastern Europe, and North Africa, so it's unclear where were its origins. It was a regular part of uniforms of many countries and today is mostly exotic fashion item and part of national costumes.
Hard hat is a necessity on any construction site today. But it wasn’t always so. Nor the first hard hats that appeared were that efficient. You can read more about history of hard hat here.
The baseball cap is a soft hat with a peak and traditionally was part of baseball uniform. This cap today even symbolizes American Culture. The first version was known as "Brooklyn style" cap. During the time the peak was longer - to protect eyes from the sun - so it's logical that today everyone wears it: truck drivers, tennis players, and police officers.
Pork pie hat is round hat known from 19th century, called that because of similarity with that time pork pie dish. The most popular were from 1830 through American Civil War, but in the 20th century, it was popularized again thanks to actor Buster Keaton, and, after that, thanks to jazz musicians such as Lester Young and Charles Mingus.