Depends on the product key source. Generally speaking an OEM license dies with the hardware. If a retail product then no problem. Also note a new pc is likely to come with windows 10 preinstalled.
--please don't forget to Accept as answer if the reply is helpful--