Apple - Charging Magic Mouse 2 when the device is turned off…
Yes, you can turn it off while charging.
However, according to Apple:
For the fastest battery charging performance, be sure your device is switched on when connecting the Lightning to USB cable.
Source: Recharge the built-in battery in your Apple accessory