One of the greatest museums on the planet, a repository of astounding artifacts from throughout human history all around the globe, from the Rosetta Stone to the Parthenon Marbles to an Easter Island moai and much, much, much more
The generic British word for dessert is "pudding."
In the 19th century, the "g" was sometimes pronounced as a harder "k." Sometimes, the "n" got dropped. Sometimes that was shortened by slicing off the "pud."
In other words, small, incremental changes resulted in pudding->puddink->puddik->dick.
It's not meant to be dirty; it's just a Victorian synonym for "dessert."
Pepper a cake with currants or raisins, and you get "spots" in your pudding, hence: spotted dick.