Which to run first: do-release-upgrade or dist-upgrade?

Upgrading to 16.04 also upgrades most currently installed packages to the versions they are in the 16.04 repositories thus meaning that they will work fine on 16.04 and non of them will be broken as long as you installed them all from the official repositories and not manually or from a PPA.

Running sudo apt-get dist-upgrade will upgrade all the packages to the latest version in the repositories for that specific Ubuntu version, sudo do-release-upgrade upgrades to new Ubuntu versions/releases.

You do not need to run sudo apt-get dist-upgrade before the other command because sudo do-release-upgrade runs the previous command first in order to make sure that all the packages on the current system are up-to-date to avoid any potential issues.

So the answer is: You can run sudo apt-get dist-upgrade before sudo do-release-upgrade, but it doesn't really make any difference because sudo do-release-upgrade runs it to start with anyway.