No one will bother you, if you take some fruits from a branch over the sidewalk. Especially in urban areas like the city centre. Still, legally it belongs to the tree owner.
In the countryside, it may get you in arguments if you take fruits from one's overgrown tree. But in the countryside there are plenty of abandoned or wild trees far away from houses, where you can pick all sorts of fruit.