Both slavery (domination) and torture (sadism) got started in the Neolithic. However they were both very nonconsensual. The very idea that they should in any way be contingent upon consent would be incomprehensible to the practitioners. Now there is no real evidence of masochism until the 17th century where a single novel makes reference to flogging as an erotic activity (most historians do not regard the medieval flagellants as true masochists). In the 18th century there are several more books such as the notorious Fanny Hill. When we get to the middle of the 19th century there is a veritable explosion of interest in Britain. Now submission can be very subtle and nuanced so it is harder to pin down but there is no clear cut evidence of it starting much sooner than masochism.