The answer to this question depends on the type of helmet you have and your personal preference. Generally, it is not recommended to wear any type of hat or beanie under a hard-shell snowboard helmet due to safety concerns.
Hard shell helmets are designed to provide maximum protection for the head and neck in case of an impact, so wearing a beanie or any other type of clothing underneath may reduce the effectiveness of the helmet by creating extra space between the head and impact-absorbing foam.