We are living in times where tattoos and body modification are more associated with fashion than related to the original idea of getting your body permanently marked for magic, spiritual or personal reasons.
Actually many believe that the first tattoos were created by accident. The most viable theory that I read was that some tribes used to treat open wounds by rubbing or patching them with some kind of herb or flower elixir, which probably produced some kind of ink. This ink while in touch with the cut created a permanent mark and at the same time due to the phototherapeutic use of it helped the wound to heal.
Even if the original meaning and origin of body modification is mostly lost along the history we know that thousands of years ago it was used in many different ways, mostly deriving from the human believes and creativity.
The little that we know about tattoo and corporal modification history allow us to say that they were sometimes used not only as part of healing or transition rituals. They were also used as identification between tribes, bravery and adulthood signs. Some warriors like the Vikings used to get their faced tattooed to frighten their rivals. Other tribes used to tattoo their female's faces to avoid them from being kidnapped or raped by enemies.
In other barbarian cultures, which became famous for their cruelty, before killing their tattooed prisoners the warriors were given the right to de-flash their prisoners and use the adorned skin as a protection charms. The same procedures interestingly enough were repeated during the WWII, but with non adorned skins. What says tons about development and modern civilization.
At this time tattoos, scarification and insertion of seeds and pits under human skin were well seen around the primitive world. Unfortunately in Persia, due to its non erasable character; Tattoos became a way of marking slaves. This idea somehow pleased the Greeks and the Romans which not only marked their slaves; they also tattooed thieves and outlaws.