In the U.S. the law varies, see: https://bikeleague.org/sites/default/files/SidewalkRiding_8_.... A checkmark in the "is it legal?" box isn't the whole story though since, I assume, cyclists also always have to reasonably safe, which is what I've been talking about. Being legal means you can justify yourself to a cop if you move your bike onto a sidewalk to avoid a 40mph six-lane stroad, not that you can buzz pedestrians.