Yes, they can—and cities do it all the time. A trash can can be shaped so it simply isn’t a comfortable seat: sloped or rounded tops, a narrow rim instead of a flat ledge, a central post or ashtray that breaks up the surface, or a tall, slim body with small openings. Placement matters too. Putting bins near handrails, in tight corners, or in high-traffic spots can discourage people from lingering, though it won’t stop someone who really wants to sit.
But design is a trade-off. A bin still needs to be easy to find, easy to use, and easy to empty. If the anti-sitting features make it hard for maintenance staff or make the street look hostile, the design can backfire. In practice, the best approach is usually subtle: angled surfaces, ribbed or textured tops, and sensible spacing rather than spikes or obviously aggressive shapes.
Also, it’s worth asking why people are sitting on trash cans in the first place. Often it’s because there aren’t enough benches, shade, or places to rest. Deterring sitting can be part of street furniture design, but it shouldn’t be the only answer. A good city can make bins bad seats while still making public space welcoming for everyone.