Debian can run on some NAS boxes directly, with more or less
effort.
https://wiki.debian.org/InstallingDebianOn/QNAP
https://wiki.debian.org/InstallingDebianOn/Synology
Some Synology models support running virtual machines on
the NAS.
https://www.synology.com/en-us/dsm/feature/virtual_machine_manager
That's pretty flexible, but they tend to be relatively expensive
and low on RAM... and while the disks are upgradable, the RAM
frequently is not.