Yes and NO. You can install any hard drive into any computer... As for installing Windows... Depends on which version you have. If you have the Full Retail version of Windows.. then YES... you can install that onto your new computer. However, if you bought the less expensive OEM version... or if it's the version that came with an OEM-type computer (HP, Dell)... then NO.. you aren't allow to do that.
A New version of Windows could be done. However, I should give you some advice, first. If you buy a new version of Windows. You need to be very careful about which version. If you get the Full Retail.. then no problem.. However, if you get the UPGRADE version of Windows... then during the install... it MUST detect a previous version of Windows installed onto the hard drive otherwise it will not accept your serial key. So make sure you keep your old/current version of Windows intact until you install the new version. If you wipe the hard drive first.. then try to install Windows using the upgrade version... it will not work.