the Fatwa Department Research Committee - chaired by Sheikh `Abd al-Wahhâb al-Turayrî
If these public parks or other public lands having fruit trees are not subject to official regulations that eating from those trees is prohibited, and if no prohibition is implicitly understood by the people of the area, then we see no legal objection to what you have done by eating fruit from those trees.
However, this permission is conditional. No fruit is to be picked at a park and then taken away to be eaten later.
This is because the Prophet (peace be upon him) said: “Whoever enters a garden may eat from it but should not take anything away in his shirt.” [Sunan al-Tirmidhî (1287)]
We should be aware that some people of knowledge have understood this permission to be for travelers only.
Others have opined that it is disliked to eat of fruit without paying for it.
However, it appears that the differences of opinion expressed by some scholars on this matter refers to privately owned gardens. This is understood from the context of their statements and from the fact that public parks were not prevalent in the past when those statements were made. Therefore, we must understand those divergent views in the context in which they were expressed.
As for the hadîth itself, it is general and applies to public parks as well as private gardens, and naturally, greater leniency is to be applied to public parks.
Of course, if there are written regulations prohibiting the picking of fruit off the trees in public parks or if this is customarily understood in society as being prohibited, then it is Islamically not allowed.
And Allah knows best.
Source: Islam Today