I’ve occasionally needed to fix certain aspects of the Dock on some people’s computers – one particular case comes to mind was an elderly client who somehow would remove the Mail icon from the Dock, and then be unable to send or receive emails.
Over at the iDownload Blog there’s an article with some very handy defaults write snippets that can lock parts of the Dock, without having to lock the entire thing.
To summarise – you can lock the position of the Dock, you can lock the size of the Dock and you can lock the contents of the Dock – all independently of each other.
defaults write com.apple.Dock position-immutable -bool true; killall Dock
defaults write com.apple.Dock size-immutable -bool true; killall Dock
defaults write com.apple.Dock contents-immutable -bool true; killall Dock
To undo any of these, use defaults delete to remove the property.