The most likely cause of Dominic contracting HIV among the options provided is:
He shared a dirty needle when injecting drugs with a friend.
HIV is primarily transmitted through blood, sexual contact, and from mother to child. Sharing needles is a well-known route of transmission for the virus, whereas the other options (inhaling droplets, not washing hands, and consuming undercooked food) are not related to the transmission of HIV.