With the exception of waiting for your takeaway order a hat should come off in a restaurant. It is outerwear after all and you wouldn't keep your coat on while dining either. In a good restaurant they will take care of your hat (and coat) and return it to you safely. Why would you want to eat anywhere else?
This "rule" is very easy to remember: if you take your coat off somewhere, you take your hat off as well. If not, both stay on.
This "rule" is very easy to remember: if you take your coat off somewhere, you take your hat off as well. If not, both stay on.