Yes this will be fine and as far as I know is perfectly legal as you own the code and all the disks are basically the same. However if your mates disk is a branded OEM it may not work. If it is one of these
Then it will work fine. I do it all the time when working on friends computers as it saves waiting hours for them to find the disks.