As a general rule, it's best not to wear hats inside the restaurant. However, exceptions can be made for religious or medical reasons.