If you open the ECU and identify which chips are the flash memory and eeprom, then look up what the pins do, you should be able to determine which pins to disconnect to prevent writing to the eeprom or flash.
Typical re-writable memory chips have a "write enable" pin and if that pin is not connected, writing isn't going to be possible. I'd assume the dealer would just get some kind of error if they try.
The dealer might want to replace the ECU, telling you it's defective. That's the only downside. You have to make sure you can stop them from doing that.
If you're really handy with a soldering iron you might even be able to mount a "write protect" switch on the ECU, with wires connecting to the write enable pin.
Or you might just destroy your ECU trying this. Heheh