Maybe, but are you sure you want to?
You don’t have to remove the hard drive. If this is going to work, you’ll simply overwrite everything on the hard drive.
There are, however, a few problems you may run into if you go down this path.
Become a Patron of Ask Leo! and go ad-free!
You can download Windows 7 installation media, but getting a legal product key can be a challenge. Once installed you’ll need to take extra steps to ensure your security since vulnerabilities now discovered will no longer be fixed. Newer hardware accessories may become incompatible with Windows 7 as well. If you can, use Windows 10. If you must install Windows 7 on your new machine, backup the factory image first so you can restore to it should you ever need to in the future.
Getting Windows 7
The first issue is simply finding a product key for Windows 7.
That is only going to get more difficult over time.
You may need to reconfigure the UEFI to run in what’s called “legacy mode”, which may be required to boot from the Windows 7 installation media, and may be required to run Windows 7 as well. If it’s required, it’s not really an issue; it can just be difficult to find or change the setting.
Securing Windows 7
You almost certainly know this, but Windows 7 is beyond its end of support date. That means you won’t get any more security updates from Microsoft for Windows itself.
You can continue to run Windows 7 safely, but it will take more work and more vigilance on your part to do so.
It is possible there will be hardware on your new machine that will not work with Windows 7.
Specifically, newer devices may not have Windows 7 drivers written for them. That means either they won’t work, or they work with only limited capabilities.
Over time, this is another problem that will only get worse.
If at all possible, I don’t recommend you go down this path.
In other words, my strong recommendation is that you give Windows 10 a chance. It’ll last longer, be safer, and is a better long-term solution.
If you can’t or won’t, I strongly suggest you do one thing first.
Save Windows 10
I predict that at some point in the future, you’re going to want to go to Windows 10 for one reason or another. It might be by choice or necessity, but it’s something I expect you to need someday. Completing Windows 10 setup will generate a digital license for your computer, and saving that image gives you the ability to revert to the Windows 10 installation your machine came with.
After you’ve taken that system image, then install Windows 7 if you’ve managed to find a copy. Make sure it formats or erases the entire hard drive and installs from scratch, and see how it goes. It’s possible it may work okay; it’s just not something I recommend.