The first point to make is that Prince Andrew is currently fourth, not second, in line to the throne.
As for his connections to York, he has a few. See his entry in Burke’s Peerage. One assumes that he wouldn’t have been appointed as a freeman of the city or as patron of Opera North, the York Minster Fund and the Yorkshire Business Conference, if he hadn’t had York in his title. For clued-up local organisations hoping to recruit a royal patron, it is no doubt a smart move to approach him first on the basis that he might agree simply on that basis. One certainly assumes that all these appointments will have been sought by the organisations themselves rather than the other way round. And, no, he doesn’t have any property there.
For other peers, whether they own land in the places from which they take their titles varies enormously. Some do, usually because their ancestor chose that particular title because that was where they already owned estates. But others no longer own land there or never did do so in the first place. As it happens, the Earls/Marquesses of Exeter are a good example of this, as they never owned estates in Exeter and their main estates were around Stamford at the opposite end of the country. Moreover, the present Marquess lives in the USA and the estates, including Burghley, are held by a trust controlled by another branch of the family.