It depends on the law where you are. Is it legal for a bike to ride on the sidewalk? It is here, but bikes have to go "walking speed" close to pedestrians and provide an audible warning when passing. The problem is that sometimes pedestrians don't hear or don't move - nobody questions what the responsibilities of the pedestrians are.