What you do is select the icon that you want to use and then go to "file" menu and then "get info" (or you can use the keystroke 'command-I').
When the small get info window opens up, select the small icon preview and you will see a box around it.
Then go to the "edit" menu and copy it (or use the keystroke 'command-C')
...once you've done that now find the icon that you want to replace and get info on that one as well. (Click on it, then use 'command-I' or go to the "file" menu and "get info")
Now when you see the icon in the get info window, click on it and then go to the edit menu and paste the icon you copied previously (or you can use the keystroke 'command-v').
That should do it...now close the get info window and your icon should be in place. Some programs in OSX are stubborn though, so don't be alarmed if you don't see your custom icon right away. Try dragging whatever icon you replaced to the dock to see if the icon replacement worked. Then you can drag it out right away.