Short answer: yes, often—but not always, and “fit” has two meanings. A typical public urban trash can is about 18–24 inches (45–60 cm) wide for a round or slim single bin. Decorative square bins often run 24–30 inches (60–76 cm), and dual bins with recycling can be 30–36 inches (76–91 cm) or more. Residential-style wheeled carts are wider, usually around 24–28 inches, but they’re not the same as sidewalk litter bins.
On a narrow sidewalk, the real issue is clear pedestrian path. Under ADA-style rules in many places, you generally need about 36 inches (91 cm) of clear width, and local codes can be stricter. So a 20-inch can on a 5-foot sidewalk can work if it sits at the curb edge or in a furniture zone and leaves at least 36 inches clear. On a 4-foot sidewalk, that same can likely leaves less than 36 inches and may block accessibility, even if it physically sits there. On a 3-foot sidewalk, I’d say no—use a wall-mounted or much slimmer bin, or don’t place one there.
If you’re choosing one, measure the sidewalk, then subtract the can width from the usable width. For a tight spot, look for 18–20 inch wide single bins, corner-mount units, or slim recycling stations. Place them so they don’t narrow the path, and check local right-of-way and ADA rules before installing. So: typical cans can fit narrow sidewalks, but only when the clear path stays wide enough.