Possible: Yes.
Legal: It depends on the OS you are using (sometimes it is tied to the old PC. E.g. Dell specific windows 7 OS which you can try to move to a new non-Dell system can work, but will probably not activate.)
Will it work: Sometimes. The hardware will differ and windows customises itself to the hardware. If it is close enough that it still boots then it probably works. If you have a different disk system (e.g. old PC uses IDE, new setup uses SAS) then it will not work.
In all cases removing as many drivers as possible might help. The perfect tool for this is sysprep.
If yes, please show me how. Thanks
Please search the site. it has been answered before.