If it's the retail version, yes. If it's an OEM version, you might have issues - but probably not. Oh, and it's need to be the full version, I'd guess, if you're planning to install it on a PC with no OS at all - if it's the upgrade version, you may struggle, unless you have a copy of e.g XP that you can install first. Reactivating it may be a pain, as your hardware configuration will have changed dramatically, so MS will think you're running it on a second PC. Do-able, though.
OnePlus 5T review: Hands-on