You definitely can, but it doesn’t mean you should… It’s a bad idea to mix up Hyper-V role with anything else, including file server. There’s some long list of reasons - why, security comes first. What you should be doing - spawn a pair of a virtual machines (You talk S2D which means you got Datacenter edition, so you’re eligible to have as many instances of the Windows Server as you want, no licensing restrictions here), put shared VHDX on top of your freshly created S2D pool and do guest VM cluster (few useful links to the guides have been added below). Within this approach you’ll be blessed, will keep CISO happy and won’t be hated when one particular role would interfere with the other to compromise performance (for example), as settings are cluster-wide.
(Deploy a Guest Cluster Using a Shared Virtual Hard Disk)
https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn265980(v=ws.11)
(Deploying a two-node clustered file server)
https://learn.microsoft.com/en-us/windows-server/failover-clustering/deploy-two-node-clustered-file-server