Is it preferable to cite the dissertation or a publication based on the dissertation?
If there is a published version of the paper, you usually want to cite that first. The main reason is that it's the version you're most sure has undergone rigorous review and revisions. As a bonus it will often be easier to find (e.g. through DOI numbers), and citations for papers "count more" so it's nice for the author(s) too. The latter two points should be in favor of also preferring citing preprint versions instead of dissertations, if that's all that's available, but it's a less clear-cut case.

However, if you find that the dissertation provides particularly helpful exposition or, as is often the case, contains information or details not published elsewhere, absolutely feel free to go ahead and cite both! (If you specifically make use of that information you clearly need to cite the dissertation.)