When you are flying a foreign flag docked in a port you are complex legal situation - in international law, you follow the laws of the flag country, in addition to being under local jurisdiction (most of the time). And if you’re flying a flag for a boat that’s not registered under that flag, which as this article explains is easily verifiable, who is going to buy the oil, and how? not to mention any possible international sanctions on the oil, customs, the crew getting paid and wanting to return home, wherever that may be, and you get situations that can last for a long time. For this case a boat to boat transfer may be the only real way.