Yes—generally, urban trash cans can be bolted to concrete without cracking it, but the job has to be done with the right hardware and a little care. The bolt itself is rarely the problem. The real risks are drilling too close to an edge or joint, using the wrong anchor, over-tightening, or hitting old, thin, or already-cracked concrete with an aggressive expansion anchor.
For a typical concrete sidewalk, I’d use a stainless steel adhesive anchor or a properly rated sleeve/wedge anchor set into a clean, correctly sized hole. Plain expansion bolts can work in good, thick concrete, but they put outward pressure on the slab, so I’d avoid them in thin, older, or fragile concrete—especially near edges or control joints. Before drilling, scan for rebar and utilities, keep the anchor layout away from edges and joints as much as possible, use the exact bit size the anchor manufacturer specifies, drill straight to the right depth, and clean the dust out thoroughly. Tighten with a torque wrench instead of an impact driver.
If the concrete is questionable, a chemical anchor is usually the safer choice, or you can use a base plate with adhesive anchors. In some very thin or fragile slabs, a ballasted or freestanding system may be the better option. Done properly, a bolted trash can should be secure and the concrete should not crack.