Let's assume I have a ship flagged in a country where certain activities are legal but are not in most of other countries (like, for instance, drug use or prostitution are in Netherlands). Let's assume again that I fullfill every aspect to lawfully carry on with those actions in the country's flag. Can I anchor the ship just outside some other country's territorial waters and provide a mean of transportation from that country to my ship? Would that be illegal?
This is just a theoretical question, so if that helps, answerers may assume any specific country where this ship could be anchored near.