The OS X Finder sidebar and Dock are convenient locations for favorite folders, documents, applications, and locations, and in addition the Dock offers a convenient place for minimized windows, as well as the Trash. For new user accounts Apple puts a default set of items in the Dock and Finder sidebar, but these can be customized.
The standard and perhaps intuitive method of adding items to these locations is to drag them there; however, it's not foolproof. If you inadvertently release your mouse before the cursor has reached the Dock or sidebar, then you chance copying or moving the item out of its current folder to the Desktop or to another window. Sometimes you can even embed items in open documents that were under where you released the mouse.
Generally these mishaps can be undone with a quick press of Command-Z (the universal "undo"); however, you can avoid them in the first place by using some convenient keyboard shortcuts to add items to the Dock and sidebar, instead of dragging them.
The first is to use the shortcut Command-T in the Finder, to move any selection of folders to the Favorites section of the sidebar. One benefit of this shortcut is that you can quickly add not just folders but also documents and applications to the sidebar, instead of having to hold the Command key while dragging them.
The second hot-key shortcut is to press Shift-Command-T to similarly add items to the Dock.
Being able to select multiple items in the Finder and add them all to the Dock or Sidebar at once can be especially convenient when you're setting up your Mac for the first time. For example, you can drag all items off the Dock for a blank slate, and then browse through the Applications folder holding the Command key and clicking items to add them to a growing selection. Then when you have picked everything you want, you can press Shift-Command-T and the Dock will be instantly populated with your selection.
Once the items are added to the Dock, you can drag them around to arrange them according to your preferences. Unlike dragging items individually from the Finder, if you inadvertently release an existing Dock or Sidebar link it won't copy the item, and instead, at most the link will disappear with a cloud-poof effect.