People have experienced positive effects from prayer, meditation, and fasting. I don't know if we can add flagellation to the list. Needs more studies.
There is no need for studies, as it's said people are doing it for thousands of years and also it matters what is good for you, not for others. Just quoting from various responses.
To give a serious answer: first you would need some prediction about how it could be useful or healthy, then you would have to check whether this prediction is satisfied in animals or in similar cases.
Here enters the remark about being commonly predicted in the millennia is weakly relevant as it might suggest that we somehow evolved to accommodate this type of diet (obviously this is not a sound argument in general eg anti-vaxxers), self flagellation does not match this criteria as it was not that common and only for very little time.
For example maybe the skin repairing process produce proteins that also lower stress.
Then, most important phase, you should check whether it can be dangerous.
I would guess that there are 0 scientific papers affirming positive effects of self flagellation.