Folders containing files can be dragged and pinned to the dock. The problem is there's no going back from there, that is you can't remove folders neither by dragging them off nor from a context menu.
I've found out it's a bug (and a quite long-standing one from the look of it). But my problem now is finding a way/workaround to remove a folder I no longer need. I guess some config files may be modified.