If you try to drag a running app that is marked to “Keep in Dock” out of Snow Leopard’s Dock, the icon will simply snap back to its place. However, after you quit the app, its icon will disappear from the Dock.

Compatibility: This was discovered on Mac OS X Snow Leopard 10.6.7. Commenter Tavi says it works in 10.5 as well.