Open the app drawer, long press on an app icon, then drag it to the dock - long press means press and hold, and *continue to hold* until the desktop shows, then drag to the dock *without letting go*.
Caveat - if you drag it to the desktop and let go accidentally, it should plant itself on the desktop - and from there you can also drag to the dock.