You need specific software that can cost thousands of dollars if obtained legally, but it's not really the bad part. Essentially anything on the CAN bus has to have it's cryptographic signature put on the ECU's whitelist of approved signatures, or it cannot be used. This can only be done with the blessing of BMW, who sells the privilege to 3rd party repair shops.
There are some hardware workarounds in some cases like spoofing auth with a 3rd party device permanently attached to the CANBUS, or desoldering and manipulating the chips used by the ECU for storage, but it's a massive hassle.
It’s not a simple OBD scanner. You need BMW software running on a laptop. The software is available online (not sure if it’s a reverse-engineered hack or pirated).