Honestly, most urban trash cans are not a great choice for composting in a community garden—at least not as they are. A standard city trash can is designed to hold waste, not to manage airflow, moisture, drainage, and decomposition. If it is sealed too tightly, the compost can turn anaerobic, smell bad, and attract pests. If it has no drainage, liquid can pool at the bottom. And if it is a public bin, it is usually city property, so repurposing it without permission is not a good idea.
That said, a clean, sturdy trash can that your garden owns could work as a DIY compost bin if it is properly modified. You would need to drill drainage holes in the bottom, add ventilation holes around the sides and lid, secure the lid against animals, and set up a system for turning or mixing the contents. It also needs to be clearly labeled so nobody throws actual trash into it. Even then, it is usually less convenient than a purpose-built compost bin or tumbler.
The bigger concern is contamination. Urban trash cans may have held plastics, cleaners, or other waste, and they can be hard to clean thoroughly. For community gardens, where food is grown and volunteers share the space, it is safer to use food-grade containers, dedicated compost bins, worm bins, or a approved three-bin system. Check local rules too, because some cities have specific requirements for community composting and public bins.
So my practical answer is: don’t just take a city trash can and start filling it with food scraps. If you want to reuse a can, make sure it is clean, owned by the garden, legally allowed, well ventilated, drainable, pest-resistant, and clearly marked for compost only. Otherwise, invest in a proper compost setup or join a local community composting program. It will save you a lot of smell, mess, and volunteer frustration later.