My child was born early, with IUGR. He was tiny and skeletal. My doctor had told me not to let lots of people touch him until he passed his original due date, but sometimes one just has to go out and get groceries.
I could not take him anywhere without some middle-aged or elderly lady getting right up into his face and trying to touch his face and hands. I don't think it stopped until he was around 3, and big enough to tell them No himself. I had to wear him in a sling for awhile just to keep people away.
It's fine to do whatever touch the mum is comfortable with, but ask first. Don't ever assume that you know what is safe or good for a child you don't know.
If you really can't help yourself, touch their feet. Not their hands. Those cute little hands really do go straight into the mouth, and a small baby has not had all their vaccinations yet. Once they're past 12 months they're a lot safer.