Here is the California Vehicle Code:
Wearing of Headsets or EarplugsSo the way I read this, when driving a car:
27400. A person operating a motor vehicle or bicycle may not wear a headset covering, or earplugs in, both ears. This prohibition does not apply to any of the following:
(a) A person operating authorized emergency vehicles, as defined in Section 165.
(b) A person engaged in the operation of either special construction equipment or equipment for use in the maintenance of any highway.
(c) A person engaged in the operation of refuse collection equipment who is wearing a safety headset or safety earplugs.
(d) 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.
(e) A person using a prosthetic device that aids the hard of hearing.
Earphone in one ear - legal.
Headphones covering both ears - illegal.
In-ear earbuds or earphones - legal if they reduce external noise.
Deaf people are allowed to drive, so you don't have to be able to hear horns. I don't know why a "headset covering" is banned, but cops will give tickets for that. You need to wear the earbuds instead.