In cycling threads you always have comments both telling cyclists to stay out of sidewalks and others telling cyclists that they "only* belong in sidewalks (and away from the road they drive in).
It is legal in some places, illegal in as many others, and has caveats almost everywhere (children are almost always allowed, in other places it is based on speed, etc.).
Generally it's more "overlooked" than allowed. In the UK for instance cycling on pavements (sidewalks) is unlawful but the guidance is to only enforce this if the cyclist is not giving consideration to pedestrians.
Realistically though I think it leads to the same state of play as everywhere else where pedestrians don't much fancy being hit by a faster moving and taller (if not larger) object so dodge out of the way even if they aren't necessarily obligated to.
In my part of small city east coast USA it is allowed except in the downtown business district (where it is syill mostly ignored.
On the one hand, not everyone wants to be required to have their 4yo ride on the road with no bike lane, but on the other hand, I hate having preteens on extra.heavy looking bikes below out of the way at me why they drive at nearly car speeds on the sidewalk.
Of course we wouldn't really have to ban bikes on sidewalks to deal with those preteens as preteens aren't allowed on electric bikes or electric scooters anyway in this state. And electric scooters aren't allowed on the sidewalk or road here.
Living in the USA, I always thought cycling on sidewalks was illegal, too, but looking it up, it seems that the laws vary from street to street, city to city, and state to state, which is ridiculous IMO.
It is legal in some places, illegal in as many others, and has caveats almost everywhere (children are almost always allowed, in other places it is based on speed, etc.).