You have to drag it onto the "folders and files" section of the dock, which is next to the trash can.
You cannot put a folder in the main applications section of the dock.
When you drop it on the dock, it will not immediately allow you to add a new item - it will instead attempt to let you drop it onto something on the dock. You may need to hold it in between two icons for a second or so before the icons slide to the side, then you can drop it on the dock.
Alternatively, you can type this into a shell to reset the dock to the default state:
defaults delete com.apple.dock; killall Dock
It will also reset a few other settings. See
defaults read com.apple.dock to see what will be deleted.
This may also work for you:
defaults delete com.apple.dock persistent-apps
defaults delete com.apple.dock persistent-others