If a tree seems like it may not be on public property, ALWAYS reach out to the property owner to ask for permission. In a large majority of cases, people are happy to share their harvest. This is a good practice even where people have planted trees on the center divide of a public street, especially when the property owner is clearly tending to said fruit trees.
Please be mindful of the effect that your harvesting will have on the plant and others that, like you, might want to enjoy its bounty. Be careful not to damage trees while harvesting; if the available quantity isn't abundant please take only what your can easily use and try to leave some fruit for the next person on a foraging expedition. If the fruit cannot be used easily and is abundant (ie cherry plum trees that are only appropriate for jams and gellies) feel free to pick the tree clean and all will be glad to be rid of the mess that this fruit often causes.
While this website provides information sharing on the location of public edibles, you are ultimately responsible for selecting fruits and shrubs that are non-poisonous and safe to eat. If you don't readily recognize a type of fruit please do your research and ask others before diving in. The same applies to the environmental contamination (heavy metals, runoff) that sometimes comes with an urban environment. While most municipalities (and the City of Berkeley is no exception) do not widely use pesticides to control weed growth, you should also try to find out as much as possible about practices in and around your neighborhood. A good rule of thumb is to avoid using plants where you have any hesitation about safety and find out as much as possible about the environment around such plants.