Sex as a form of self-harm?

I (19m) was wondering if sex could be used as a form of self-harm through asking a dominant to hurt me by telling them I'm a masochist, despite it being a lie, but instead telling them to keep going even when I really don't like it anymore.

I could be like, getting beaten by them and just not say anything or ever use a safe word so I can keep getting hurt.

Is there any reason this would be something bad to pursue over other forms of self harm?