Hat etiquette was developed mainly as a way of showing respect, social grace, reverence, etc., although these etiquette were subject to change as time passed, and are now considered by many as a person's individual choice. Even so, it is better to be considerate of the situation you are in, as well of other people present.