Modern helmets provide all the necessary warmth and ventilation, leaving no space for a hat, both figuratively and literally. A helmet should provide a snug fit. Putting a hat underneath won’t allow it to fit your head well and might risk lowering the protection it will provide in case of an impact.