Sometimes. Not all XP games and programs will run under Vista — it depends entirely on the specific title.
The first thing to do is check the software's compatibility information, because that will tell you outright. Where something does not work normally, Vista includes an XP compatibility mode that makes a fair number of older programs run correctly. Right-click the executable, open Properties, and set the compatibility options to report as Windows XP.
— Neeraj Sharma
My own experience was less encouraging. On my machine, a long list of things simply did not work under Vista: various MP3 players, iPods, Palm pilots, my phone, and plenty of other devices. Some games ran and some did not, with no obvious pattern.
That inconsistency was the defining complaint about Vista at the time. Driver support lagged badly behind the OS release, so hardware that worked perfectly under XP had nothing to talk to. If you are running Vista today, the practical advice is to check for updated drivers first, and to consider that an upgrade to a supported version of Windows will solve more problems than any compatibility setting.