You certainly can do that, but it would be way over-kill IMO. I use a 2012 Mini as a Time Machine server and a 2014 Mini as a media server and they are even more powerful than needed for these tasks. You can get used 2012 Mini's with a warranty from OWC (MacSales) for $135 or used 2014 Mini's for under $100.
Of course, there's nothing wrong with using the M1 mini since you already have it and it will be supported for longer. The 2012 Mini only goes up to Catalina and the 2014 stops at Monterey.
BTW, maybe Apple has changed things in newer versions of MacOS, but I found setting up a Time Machine server completely un-intuitive on Catalina and had to use Google for instructions. The function is there, but the menu is pretty well hidden. 🙂