Yes, you can. I savage the win 7 license from my 5 yrs old company old PC and used for new PC. Worked like a charm
Online license seller build their reputation around no of positive reviews. In the past, I bought various $10-$15 license, in few rare cases, license does not work anymore and I got no trouble request them for replacement.
On another hand, Microsoft dun really need home users to buy the license, what they truly follow is " Windows for everyone" path, that's why M$ aggressive push all of their users to change to W10.
That's why you can get the key everywhere, from old W7, W8 PCs, you can even use W10 without license like forever.