That's an excellent and practical question. The short answer is: sometimes, but it's often not that straightforward. While many hardware stores do carry a variety of trash can liners, the liners for public, urban trash bins—like those in parks, on sidewalks, or at bus stops—often have specific requirements that standard off-the-shelf bags might not meet.
These municipal bins are typically much larger and more heavy-duty than household bins. Their liners need to be extra durable, often made from thicker, puncture-resistant plastic, and come in very specific dimensions to fit the custom-sized containers. A regular large kitchen bag simply won't fit or hold up.
Your best first step is to check the bin itself or contact your local city's public works or sanitation department. They can tell you the exact size and type of liner used and may even sell them directly or provide a list of approved suppliers. Some larger hardware stores or janitorial supply companies might stock these commercial-grade liners. You can also find a wide range of sizes and gauges (thicknesses) through online industrial suppliers. So, while a local hardware store might have a solution for a smaller bin, for official public bins, going directly to the source or a specialized commercial supplier is usually the most reliable route.