Today most rubbish on ships is incinerated (burnt). However some rubbish can be put overboard providing it has gone through a machine to grind it down into pieces less than 25mm and only dumped when the ship is far away from land, that is, more than 12 nautical miles which is about 20 km.
No plastic may be thrown into the sea from any ship, fishing vessel or even yachts and motor cruisers. This includes ships from all nations and includes the seas and oceans all over the world. There are restrictions on the disposal of all other rubbish. Ports must provide facilities for ships to dispose of their garbage, in just the same way that rubbish is collected from your house by the local council.