There are rules for all road users in most countries. Rules for pedestrians govern where and when they may cross roads, and usually prohibit walking in lanes designated for faster moving vehicles. Busier or faster streets tend to have rules that impose more separation between pedestrians, cyclists, and cars, and blame for a collision usually falls on whoever violates them.
This is partly for safety of course, but it is also intended to support throughput. People and goods do not flow easily in cities where trucks move at walking speeds.
I can talk only about Germany. If there are sidewalks, pedestrians have to use them, also if there are special assigned bike paths, they have to be used too. But where those features are missing, both pedestrians and bicyclists have to use the road - unless it is marked as a motor way. And of course a road can only be marked as a motor way, if there are alternative ways to reach the same destination for the prohibited vehicles.
Shift blame to the pedestrians instead of the cars.