When I took delivery of my M1 mini, although I had a bluetooth magic keyboard and mouse, I used wired versions during the initial setup process, and provided my Mojave Time Machine (SSD) drive to migration assistant to replicate my iMac home directory. This went well, and upon reboot, I powered on both the Magic Keyboard and Magic Mouse 2, and visited bluetooth preferences to connect them as they would not do this on their own.
Once my bluetooth peripherals were connected, I powered down the M1 mini, and disconnected the wired items. On reboot, it recognized the bluetooth keyboard and mouse (as it should).