Protect chipping frame from metal bike lock with Sugru
Any protection must be applied to the bike, as dirt between the lock and bike will abrade both, but the bike is more fragile and valuable.

The only way to avoid dirt is to not use the bike. Stickers are good but have to be replaced fairly often. Cable ties and clear repair tape are also useful. I've used reflective tape on the seat stay of one bike where the D lock abrades the paint.

An old fashioned solution that works very well is to use an old inner tube on the bike, strapped or knotted in place