I always had the
/home folder and the system files on seperate partitions on my hard disk. Whenever I reinstalled the system the
/home folder was left untouched and in the installation procedure I simply used the
/home partition for the
/home mount point (without formatting). The newly installed systems never had any problems.
So, this scenario would correspond to: "Copy dotfiles first, then install software".
My intuition is that most newly installed programs would first look wheter a given configuration directory ("dotfile") exists. In case they do the software would load configuration data frome there. In case they do not the software would create the dotfiles an initialize default configuration values.