(a) The following persons may operate a motor vehicle in this state without obtaining a driver’s license under this code:
(1) A nonresident over the age of 18 years having in his or her immediate possession a valid driver’s license issued by a foreign jurisdiction of which he or she is a resident, except as provided in Section 12505.
(2) A nonresident, 21 years of age or older, if transporting hazardous material, as defined in Section 353, in a commercial vehicle, having in his or her immediate possession, a valid license with the appropriate endorsement issued by another state or other jurisdiction that is recognized by the department, or a Canadian driver’s license and a copy of his or her current training certificate to transport hazardous material that complies with all federal laws and regulations with respect to hazardous materials, both of which shall be in his or her immediate possession.
(3) A nonresident having in his or her immediate possession a valid driver’s license, issued by the Diplomatic Motor Vehicle Office of the Office of Foreign Missions of the United States Department of State, for the type of motor vehicle or combination of vehicles that the person is operating.
(b) Any person entitled to the exemption contained in subdivision (a), while operating, within this state, a commercial vehicle, as defined in subdivision (b) of Section 15210, shall have in his or her possession a current medical certificate of a type described in subdivision (c) of Section 12804.9, which has been issued within two years of the date of operation of that vehicle.
(c) A nonresident possessing a medical certificate in accordance with subdivision (b) shall comply with any restriction of the medical certificate issued to that nonresident.