That said, if you have a (like replacing the logic board yourself on an otherwise dead machine and needing to match the original serial for software compatibility), here's the technical reality for the M1 MacBook :
While older Intel-based Macs sometimes allowed serial number modification using specific service tools (like the "Blank Board Serializer") after a logic board replacement, Apple Silicon (M1, M2, M3) has much stricter hardware-level locking. Key Obstacles for M1 MacBooks macbook m1 change serial number