If your boat has a storage tank on-board, you should only empty it at dump stations on shore. These stations take the waste and treat it, so it isn’t harmful to the environment.
On the flip side, if you have a cassette toilet for a boat, you can empty the cassette in a standard restroom if you don’t have a dump station nearby.