Eastern grey squirrels were deliberately introduced into city parks for the enjoyment of people.[1]
Also wild animals are flexible enough in their behaviour to accommodate interactions with humans.
If you observe them carefully, you can see them switch from 'normal' behaviour to the behaviour they use when interacting with people.
It's kind of like when you speak two languages and can switch from one to the other in an instant.
[1] The Urbanization of the Eastern Gray Squirrel in the United States Etienne Benson J Am Hist (2013) 100 (3): 691-710.