Upvote:2
This can be arranged with the cruise line but they are in no way obligated to. There is no legal reason preventing it other than between 2 US ports in some circumstances.
Crew, often entertainers, will do this to rotate across ships.
You can always ask. And, realistically, you're not a prisoner and barring any local regulation, they can't make you finish the sailing. Just don't expect a refund or anything.
Never abandon ship, this creates problems for everyone else and you risk being blacklisted.