Yes. I made my 2012 Intel Core Duo dual-core Intel i5 into a ROCK. You just need a generic compatible USB Ethernet adapter. I have a Cisco/Linksys that uses an ASIX AX88772A chip. Works like a charm.
Using a new M1 Mac mini would be a waste and the ARM processor probably wouldn’t work. You can find a i5 or i7 Mac mini for $200 on OfferUp or Craigslist pretty easily.
[Moderator Edit: CPU specification corrected]