Hats are compulsory at a diminishing number of social occasions.
Women should wear a hat to Royal Ascot and smart race meetings; hats are
traditional, but by no means compulsory, at weddings, and a matter
of personal choice for christenings and funerals.
It is notoriously difficult to socially kiss while wearing a wide-brimmed hat. There is a knack to tilting the head at a suitable angle, but two ladies both in wide brimmed hats should avoid such an 'intimate' greeting.
Nowadays, gentlemen rarely wear hats except for morning dress, when grey felt top hats are de rigueur for the wedding party. They should be worn on the front of the head or carried under the arm, but should not be worn indoors or in the formal photographs.
For the Royal Enclosure at Ascot, however, they are obligatory and must be worn at all times. It's also important to perfect 'doffing' a top hat - raising it above the head to greet guests with real panache.