There is no such thing as a tree dentist (although there are tree surgeons). However, if there were one, he would work on the tree's 'bite' (which is meaningless, but the joke reader will skip over that realization). When he became a dermatologist, he would then work on the tree's 'skin', or 'bark' instead.
This leads us to the irrelevant proverb that a 'dog's bark is worse than his bite'. Playing on the polysemous nature of 'bark' and 'bite', the joke writer leads us to see why the tree dentist would change to the more lucrative occupation of dermatologist.
Haw, haw, haw! Get it?