This is an incomplete and not fully authoritative answer but it may answer some of your questions. Footnote 85 to a law review Note (i.e. student written law review article) by Maria Efaplomatidis from 2000 lists a number of international treaties that govern pollution from merchant ships. It cites the following treaties as relevant (as of the year 2000, of course):
International Convention for the Safety of Life at Sea, Nov. 1, 1974, 32 U.S.T. 47
The Protocol of 1978 Relating to the International Convention for the Prevention of Pollution From Ships, Feb. 17, 1978, 17 I.L.M. 546, (SOLAS)
International Convention for the Prevention of Pollution from Ships, 1973, and the Protocol of 1978 ("MARPOL")
International Convention on Standards of Training, Certification, and Watchkeeping for Seafarers, 1978 ("STCW")
Multilateral International Regulations for Preventing Collisions at Sea, Oct. 20, 1972, 28 U.S.T. 3459 ("COLREGS")
United Nations Convention on the Law of the Sea, Dec. 10, 1982, 21 I.L.M. 1261
Agreement for a Cooperative Vessel Traffic Management System for the Juan de Fuca Region, Dec. 19, 1979, 32 U.S.T. 377.
I don't have easy direct access to all of those legal sources myself.
The article you appear to be referencing, originally from Reuters, discusses oil tankers flying under a Venezuelan flag that were impounded in Caribbean ports, under the admiralty law of those ports, for not paying bills to firms that clean oil waste from the sides of oil tankers, non-payment which is also preventing other ships from getting cleaned.
My guess, without reading the relevant treaties, is that consent to jurisdiction by the country under whose flag the ship operates subjects a ship to the treaty.
I would also guess that the effect of the treaty as implemented by member states is only to ships that intend to travel to international waters or are coming in from international waters (to leave coastal boats in national waters to local regulation).
I suspect that ships in violation are not permitted to leave the ports of a signatory. I doubt that a coast guard or naval ship of a signatory state would impound such a ship while it is actually in international waters, although I have no hard evidence for that assumption.