The issue is that, while the CPU instruction set is largely (completely?) compatible between systems, the peripherals are not, and the drivers are often handled by closed-source binary blobs that are not portable to other operating systems. So while you could get code to run on the CPU, you wouldn’t have networking, display, audio, etc. Same reason you can’t just drop Linux on any old Android phone or tablet either (some you can, but not many).
OPNSense is a great option for turning x86 hardware into a router. That said, I would not recommend combining your router with other functionality. The router should be a dedicated system that only does one thing. Leave your NAS and web services on another machine.