Permanently remove icons from Dock
This answers it partially.
When I encountered the same problem on El Capitan, these steps solved it.


Disable System Integrity Protection.
sudo /usr/libexec/PlistBuddy -c "delete:add-app" /System/Library/CoreServices/Dock.app/Contents/Resources/com.apple.dockfixup.plist
sudo /usr/libexec/PlistBuddy -c "delete:add-doc" /System/Library/CoreServices/Dock.app/Contents/Resources/com.apple.dockfixup.plist

Re-enable System Integrity Protection.


I referred to another discussion for PlistBuddy