The only person who's given a correct answer so far is Ratter.
It will depend on the licensing terms for the particular bit of software.
For example, Windows can be either a OEM license or a retail License, if it's OEM licensed then it's tied to the computer hardware and can only be sold with the hardware, if it's retail licensed then the EULA says you are free to sell it as you wish.... MS office is the same, it can be either OEM or retail and the same rules apply.
For most other general software (games and the such) you would be free to sell on as you wish, but again the only way to be sure is to carefully check the license agreement for the transfer of ownership terms.
Most general software would be under a retail license model