Yes, it should not be a problem. The only time you would run into any problems is if you change the motherboard, and usually that can be worked around as well, legally. Honestly, if you are going to reinstall anyhow, it would be a really good time to upgrade to Windows 10. The free upgrade still works and support for Windows 7 will be ending, all support, next January. It is already EOL with only extended support right now.
Windows 7 lacks in many areas, most especially driver support for newer hardware and memory management. I've managed to get several very old Core 2 duo systems running with no problems at all on Windows 10, and have seen much older systems work fine with it so I doubt you'd have any trouble in that regard unless you've already tried and had issues with driver support on some very old hardware.
Regardless, doing a clean install of windows is your best bet, whether you use 7 or upgrade to 10.