Running a VM on a NAS takes a lot of resources so you would need to choose one with good processor and RAM. An alternative ( if you want to run a virtualized Linux app ) is docker. both Qnap and Synology have Docker support which takes very little system resources .
With Virtual Machine Manager, you can run virtual machines on selected models of Synology NAS. This FAQ will guide you on how to calculate the number of virtual machines that you can run on your Synology NAS, with recommended numbers at the end of the article.