Normally users should be able to add items to the Dock and move them around, but sometimes (especially after installing some third-party software) people may find that the Dock will become locked and they can neither move items around nor add or remove them.
There may be a few reasons why this happens, including faults with the Dock preference and database files in addition to odd settings that may be added to the Dock when you install applications.
The first thing you should do if this happens is to locate the Dock's settings files and check that they are not locked. Go to the /username/Library/Preferences/ folder and locate the files called "com.apple.dock.plist" and "com.apple.dock.db." Then get information on these files and check the status of the "Locked" attribute in the info window. The files should not be locked.
Next ensure your username is given both read and write permissions for both of these files. You can do this by checking the permissions field at the bottom of the information window, or you can run the following commands in the Terminal to set the ownership and permissions for these files accordingly (copy and paste all lines of each command, and then press Enter):
sudo chown `id -un` ~/Library/Preferences/com.apple.dock.plist\
sudo chmod 644 ~/Library/Preferences/com.apple.dock.plist\
When the files have been set so they are readable, run the following command in the Terminal, which will write a setting to the Dock preferences files that ensures items in the Dock can be moved. The command will relaunch the Dock after the setting has been written.
defaults write com.apple.dock contents-immutable -bool false; killall Dock
If these efforts do not clear the problem, then the issue is likely with the formatting of these documents and you will need to either erase them and start over, or restore backups of them from times when you know the Dock was working properly (likely just before you installed the third-party software). You can do this by opening the Preferences folder in the Finder and then using Time Machine to locate and restore backup copies of the files.
If you decide to remove the files and start over, then your Dock will be reset to the default settings and any customization will be lost. Be sure if you need to do this that you write down what applications are in the Dock and their organization, among other settings.