Did this happen in spite of proper socialization?
Yes, positive training and socialization should get him at least indifferent. At this point, I’d recommend doing that with professional guidance, though, where situations can be fully controlled to keep things below his threshold.
How old is the dog? What breed? How long has it been happening? How often/how many times? Is he actually vomiting or just heaving? Is there heaving with the expelled content or does it just seem to come out? Is he vomiting food, bile or other? Does it smell bad? Does it look like coffee grounds? Is there blood in it? Does he seem in pain? Are there other signs, such as not eating, diarrhea, lethargy? Are the gums nice and pink? Is the stomach distended? Is the saliva thick, gums sticky and are there other signs of dehydration? Could he have gotten into something he shouldn’t, such as garbage or found something outside? Is he vomiting only in the morning/on empty stomach? Could he have eaten an object such as a piece of a toy or otherwise? …
You see, there are many reasons a dog will vomit and various urgency to see a vet about it.
Vomiting puppy needs to see a veterinarian as soon as possible.
Dry heaving – trying to vomit but nothing actually coming out is the most dangerous and can signify bloat. Total emergency that needs medical intervention immediately.
Vomiting “coffee grounds” or blood requires medical attention right away.
Vomiting with diarrhea and lethargy or other worrisome signs requires medical attention as soon as possible.
Vomiting with signs of pain and/or distended abdomen requires medical attention as soon as possible.
Dry sticky gums, pale gums, skin that lacks elasticity requires medical attention as soon as possible.
There are many things to consider, first of which is to determine whether your dog needs to see a vet right away.
From your question I assume it happened more than twice, so you should see a vet anyway.
Meanwhile, I would withhold food for 24 hours and give a little bit of water only if he holds that down.