Can I install Windows 7 to my computer if I use the Ryzen 5 2600X?

You can try.
Likely, your motherboard does not support windows 7, meaning that you may not be able to use usb3.0 and may not be able to install any other motherboard drivers.
Nvidia still supports windows 7 drivers so that would be ok.
It would not bother me one bit to not get any updates at all.

I am with you on not liking windows 10.
It is most intrusive.
There are about 10 settings that need to be turned off.
I do ok using windows classic shell that will give you the appearance of windows 7.
It might be worth going the PRO route on windows 10. That lets you defer on upgrades for a year.

Ultimately you probably need to go to 10.