According to the DMV:
27400. A person operating a motor vehicle or bicycle may not wear a headset covering, or earplugs in, both ears.
*400. A "motorcycle" is any MOTOR VEHICLE having a seat or saddle for the use of the rider, designed to travel on not more than three wheels in contact with the ground, and weighing less than 1,500 pounds.
**This prohibition does not apply to: A person wearing personal hearing protectors in the form of earplugs or molds that are specifically designed to attenuate injurious noise levels. The plugs or molds shall be designed in a manner so as to not inhibit the wearer's ability to hear a siren or horn from an emergency vehicle or a horn from another motor vehicle.