Although there are obstacles, as suggested by Bill Smithers, if you have Windows 7 Professional (or Ultimate or Enterprise), a reasonably modern computer, and you do not need much in the way of graphics capability, you can install "XP Mode," which Microsoft made available for Windows 7 to ease the transition from XP to 7 for business customers.
The Microsoft download links for XP Mode and the Windows Virtual PC are no longer valid, but you can still get the required files via the Wayback Machine.
If you think you might be interested in this, read this very long and detailed article first: https://arstechnica.com/information-technology/2010/01/windows-xp-mode/ Probably the most useful part of that article comes towards the end:
But what kind of apps does it work for? Well, it's important to remember what the target market is: line-of-business applications. It's not for games, it's not for anything that's too performance sensitive, it's not for anything that needs hardware access; it's for all those crappy applications I talked about before. So... there's no 3D acceleration; no OpenGL or Direct3D in the Virtual Machine. I wouldn't want to run any graphically intensive DOS applications either; a solution such as DOSbox is probably better there. Though not surprising for the target usage (prior versions of Virtual PC don't support 3D acceleration either, after all), 3D acceleration is something that other virtualization software is starting to provide.
If you have a piece of hardware that's incompatible with Windows Vista/Windows 7 then Windows XP Mode might be of some assistance. The new Virtual PC adds USB passthrough support (allowing USB devices to be used within the VM), in addition to the serial port passthrough available in previous versions of Virtual PC. No such joy for PCI devices, however, so old/unsupported sound cards aren't going to spring into life with XP Mode.
Still, it's Windows XP, so software compatibility is pretty damn broad. If your line of business application works on XP but won't work in Windows 7, then as long as it's not 3D, it'll work in Windows XP Mode too. The same is true of, for example, Cisco's VPN client software; it'll be a bit clumsy to use, but it'll work, and it can create VPN connections. This has long been a thorn in Vista and Windows 7 users' side, and Windows XP Mode provides a solution of sorts.
Post back here if after reading that you would like to know how to install XP Mode.