The most likely cause of Dominic contracting HIV from the options provided is:
He shared a dirty needle while injecting drugs with a friend.
HIV (Human Immunodeficiency Virus) is primarily transmitted through direct contact with infected bodily fluids, such as blood, semen, vaginal fluids, and breast milk. Sharing needles is a well-known risk factor for HIV transmission, as it allows for direct exposure to the blood of an infected person. The other options (inhaling droplets, not washing hands after restroom use, and consuming undercooked food) are not associated with the transmission of HIV.