A concept I came across in a historical fiction novel set in the early 1700s. Like it sounds, a husband divorcing his wife by selling her to another man. How widespread and accepted was this practice?
It depends how you define "accepted". The church didn't accept it as a valid way to break a marriage, and the couple were still married under common law. Church rules for marriage-ending focused on reasons why the marriage retroactively never counted (an annulment) - one spouse had been below the age of consent when the marriage occurred, there had never been a consummation, etc. - and divorces based on one spouse's treatment of the other after the marriage were, for centuries in England, impossible to obtain.
For the upper and middle classes, this meant very few ways of getting rid of each other, because they were prominent enough to local authorities that they would certainly be caught if they remarried bigamously. The wealthy could resort to a separation by deed, a legal document devised in the late seventeenth century which allowed two people to separate and contained agreements for custody and for the wife's financial upkeep, but just as today, a legal separation didn't allow people to remarry until their spouse's death. There was also the option of a divorce a mensa et thoro, which was essentially the same thing but done through the church, and even more expensive. If initiated by a wife, she had to prove extreme abuse and flagrant adultery, with eyewitnesses, and without herself having done anything that could be perceived as provocation. And lastly, it also became possible from the late seventeenth century for the very wealthy (I believe every case of this I've ever seen involved a duke and duchess) to get an Act of Parliament to grant a full divorce that allowed for remarriage - an intense proceeding requiring the husband to prosecute his wife's lover for "criminal conversation" in a court of law; once he won, he could move on to the divorce a mensa et thoro (since the adultery was proven), and then send a bill the House of Lords to be publicly debated and enacted. It's not until 1857 that England had provision for a proper divorce court, and not until the twentieth century that men and women who wanted a divorce had to prove the same standards of guilt.
The poor, on the other hand, had paradoxically less and more freedom. Less freedom because none of these formal, legally accepted options were available to them - more freedom because they simply weren't under the same degree of scrutiny. (Or, I should say, not necessarily under the same degree of scrutiny. During Cromwell's reign, for instance, there's evidence of quite a lot of scrutiny being applied to moral crimes all the way down the social ladder.) One method for separating that was sometimes used, supposedly dating back to the early Middle Ages, was the divorce by sale, in which, as you describe, a husband led his wife to market with a rope around her neck and sold her. Was this accepted? Well, it was accepted among the people who practiced it - but it was not legal and not valid in the church, and anyone who remarried after such a divorce was open to charges of bigamy. You had to be fairly sure that you were insignificant enough for nobody to care what you did, because this was definitely a folk practice and nothing something broadly socially sanctioned.
Divorce by sale obviously sounds like sex trafficking, but it's important to look at the few actual cases we have recorded in which couples separated by another man "buying" the wife. For instance, one in 1795 involved the husband making a receipt that noted that the sale rested on "both parties being willing to part". On the other hand, there's the experience of famed pirate Anne Bonny: she also tried to take advantage of the custom to get away from her abusive husband, but the governor of the Bahamas refused to recognize it and declared that by living with Jack Rackham she was exhibiting "loose behavior". It's quite likely that this practice was more often a way for a woman to leave her husband for a man she already wanted to be married to, with the exchange of money lending it a feeling of formality and legality, rather than what we see in The Mayor of Casterbridge.