Self-flagellation
Self-flagellation is the act of hitting oneself with a whip as part of a religious ritual.
Roman Catholicism
The Flagellation refers in a Christian context to the Flagellation of Christ, an episode in the Passion of Christ prior to Jesus' crucifixion. The practice of mortification of the flesh for religious purposes was utilized by some Christians throughout most of Christian history, especially in Catholic monasteries and convents.
In the 13th century, a group of Roman Catholics, known as the Flagellants, took this practice to its extreme ends. The Flagellants were later condemned by the Roman Catholic Church as a cult in the 14th century because the established church had no other control over the practice than excommunication.
Self flaggation has not been practiced in Catholicism for many decades, at least one century.
Islam
Shia communities worldwide march in massive parades every year on the Day of Ashura to commemorate the Battle of Karbala and the martyrdom of Imam Hussein, while hitting themselves on the chest. Though it is uncommon, some Shia communities hit themselves on the back with chains and sharp objects such as knives. This happens in many countries around the world including India, Pakistan, Iraq, Lebanon, United States[1] and Australia. In Iran use of knives and sharp blades for flagellation is strictly forbidden but chains are used. In Saudi Arabia they are strictly forbidden in every form.