What meaningful difference is there between S&M and domestic abuse?

The karate instructor (usually) knows when to stop.

Consent is important here, but can you consent to injuries, even if they are minor?

For example, you cannot consent to be murdered, plain and simply. I’m also sure you couldn’t consent to something that has a remotely high likelihood of causing death(for example, shooting someone with a gun).

So, where does the line stop? If, say, I consented to someone stabbing me in the hand, does the state have the right to prosecute that person anyway, even if I don’t want to press charges?

This sounds like a difficult legal question, and I don’t know where consent makes a legal difference to whether or not a crime occurred in the case of injuries, which S&M stuff would include.