Ethical systems

Probably the first ethical structure put forward in a BDSM context is
contained in de Sade's "Dialogue Between a Priest and a Dying Man" (1782):

Marquis de Sade wrote:
the entirety of human morals is contained in this one phrase: render
others as happy as one desires oneself to be, and never inflict more
pain upon them than one would like to receive at their hands.

This is a Sadean variation of an ancient principle, the Golden Rule,
"do as you would be done by", but with a subtle twist about receiving
and inflicting pain appropriate for someone like de Sade who was both a
sadist and a masochist himself.

Slakker`s ABC of BDSM wrote:
For lots of leatherfolk, pain is a goal of their play. We claim the
right to decide for ourselves what sexual activities we will partake in,
including pain play. As long as no one is harmed, and by that we mean
that no damage is done which does not readily and quickly heal, we
believe that the government (and everyone else) has no right to
proscribe our actions.
However, as with most other democratic freedoms, the rights which we
claim come with a heavy load of responsibility. One who is not prepared
to accept that responsibility should never pick up a flogger.
We are responsible for the health and safety of our partners and ourselves.
Remember, it is okay to hurt your partner (i.e., cause pain), but you
must never harm them.