I had occasion today to install some updates on one of my macOS systems and found myself inconvenienced by a number of applications adding a pile of dock icons without asking. I don't keep much in the dock on my systems preferring to use clover+space to launch applications and I don't think I have touched the dock layout in literally years at this point so I went searching for a solution.
From chflags(1) the 'schg' flag makes a file system immutable, meaning not even the super-user (root) can alter it.
A quick cleanup of my dock and chflags schg on ~/Library/Preferences/com.apple.dock.plist seems to have prevented further changes by installers.
You will have to chflags noschg the plist file to make any changes to the dock stick in the future.