I don’t know much about the M2 in particular, but yes you should be able to use a single speed on a smart trainer. I took a different path to get there, but I have a dedicated trainer wheel and I have a single cog on there:
Since I’m on a smart trainer and I don’t change gears, it works just fine.