Your question is very good, but why do you limit it to piercing or tattoos, what about regular wounds, hunting accidents and even births?
The basic answer is indigenous medicine methods (which you can read about in this site); although we think that the art of medicine was invented in the west it was with man for a long time.
You also must remember that the body (especially the body of our ancestors) is a very strong machine that can combat many bigger threats then piercing.
So you can say that in the best scenario some priest would poor some water on the metal or bone piercing or rub some primitive medicine on the skin.