Welcome to Apple Support Communities
Maybe the Dock settings file is locked because of a permissions problem, so try to remove it. Open a Finder window, select Go menu (on the menu bar) > Go to Folder, and type ~/Library/Preferences.
Then, delete "com.apple.dock.plist" and restart. The Dock will be back to default settings and Mac OS X will create a new Dock settings file, so you should be able to remove and add items to the Dock.
Also, note that you can't remove apps from the Dock that are opened. In that case, you will have to close the app, so the app will disappear if it's not set to keep in Dock