Can you elaborate on what you are trying to accomplish? Windows itself is not dedicated to a specific piece of hardware. If both systems are on the Hardware Compatibility list, Windows will install on either system.
With regard to licensing though, if you bought a computer and it came with Windows 7, that license was assigned to that device. Its not that the key provided wouldnt work on a different piece of hardware, it is that their EULA does not allow for transferring licenses from one system to another.
You are going to need to purchase a retail version of Windows for this system. HP versions of Windows are locked to HP hardware (sometimes specific models). They are OEM copies that check for identifying information on the system when they boot up.