I get why this idea appeals. Cities are full of hard surfaces, and a trash can top looks like a free little platform for greenery. The short answer is: yes, it can sometimes be done, but it is usually a bad idea unless the setup is purpose-built, approved, and carefully maintained. The big distinction is whether you mean placing a removable planter on top of a bin or filling the top of the bin itself with soil. The first can work in limited situations; the second is where most problems start.
The biggest issue is structure. Wet soil is surprisingly heavy, and most urban trash cans are designed to hold lightweight waste, not a deep load of soil, water, and plants. Lids, hinges, and latches are not usually built for that kind of constant weight. If the lid bends, collapses, or becomes hard to open, you create a safety issue for pedestrians and a practical problem for collection crews. A bin that cannot be opened or emptied properly will quickly turn into an overflowing mess.
Drainage is another major problem. Plants need drainage, but a trash can top usually does not provide it. Water can pool, stain the bin, breed mosquitoes, and create smells. If the planter is not lined and managed properly, runoff may carry dirt, fertilizer, and trash residue onto the sidewalk. In a public space, that is both ugly and a hygiene concern.
Then there is the sanitation side. Trash cans collect food waste, liquids, sharp items, and all kinds of residue. Growing plants directly on or in that surface is not ideal, especially if anyone might be tempted to grow herbs or vegetables. Contamination is hard to control, and the combination of waste, moisture, and plants can attract pests. A decorative, non-edible planting scheme is safer than an edible one, but even then, maintenance matters.
You also have to think about access. A trash can has a job: collecting waste. If a planter blocks the opening, hides the bin, or makes it harder for crews to empty, it is a net loss for the street. Cities also have rules about street furniture, right-of-way, permits, and liability. Putting plants on a public bin without permission can create maintenance duties and risk that no one has agreed to take on.
If someone really wants to try it, I would treat it as a removable, lightweight, decorative planter system, not a permanent soil-filled lid. Use a secure tray or shallow planter with drainage, choose drought-tolerant non-edible plants, keep the bin opening and collection access clear, secure everything against wind, and get permission from whoever owns the bin. Plan for watering, weeding, litter removal, and replacement. Honestly, dedicated planter boxes, community garden plots, movable planter carts, or wall-mounted planters are usually better options.
So, can urban trash cans be used as planters on top? Technically, yes, with careful design and permission. But as a casual DIY idea, it is usually a bad one. Greening a street is a great goal; attaching it to waste infrastructure is just not the easiest or safest place to start.