Honestly, it depends on the bin—but most urban trash bins are not meant to fill up like buckets. A well-designed public bin usually has a lid, a sloped top, or a hooded opening that keeps most rain out. Some also have small drainage holes or a raised inner base so water can escape instead of pooling around the bag. In cities where bins are emptied often, rainwater is usually a minor issue.
That said, yes, bins can get gross if they are poorly maintained. If the lid is broken, the opening is left wide open, or the bin is already overflowing, rain can get in and mix with food waste, wrappers, and whatever else people throw away. That creates a nasty soupy mess at the bottom, which smells bad, attracts flies and mosquitoes, and makes the bin heavier and harder to empty. It can also leak dirty water onto the sidewalk.
So do they fill up and get gross? Sometimes—but not usually in a well-run system. The biggest factors are design, drainage, frequent emptying, and quick repairs. A good urban bin is built to shed rain, contain waste, and be cleaned regularly. A bad one becomes a wet, smelly problem fast.