You could do this in Windows 98, and as long as the machine would boot with the same drivers already installed for the previous hardware, it would run and let you install any drivers needed for the new hardware. Since XP (probably NT 4.0, but I have no direct experience with that version), if Windows detects a "significant" hardware change on startup, it'll refuse to boot and require a reinstall. This will occur even if the same CPU, RAM, and video hardware are carried over to a new motherboard (I've encountered exactly this), and the same appears to be true of Vista and Windows 7.
I haven't used Win8 or later, but it's very likely the same for those, because it's a way for MS to limit your ability to use a single installed OS across upgrades, hence collect more license fees. FWIW, it probably wouldn't work well unless the new MB, CPU, and video are nearly identical, so reinstalling would be a good idea anyway.