Of course, it depends on how expansive your definition of “hat” is relative to “headgear”.
The list of types of hats in https://en.wikipedia.org/wiki/Hat includes some that are commonly worn due to religious tradition (e.g. kippah, mitre, turban, zucchetto).