To answer that question properly, one has to consider that Doktor is a academic grade, while Professor is an official title compareable to General or Bundeskanzler. This plays an important role not only inside Universities, where old traditions still regulate how two Professors have to approach each other, but also for daily use: To handle the so called "Professorenproblem", the Munich University recommends, to write Professor in an extra line, separated from name and title, when adressing a letter.
Herrn Professor
Dr. Dr. h.c. mult. Claus-Wilhelm Canaris
Adress
This is a contradiciton to DIN 5008, whish recommends to write Herr. Prof. Dr. Faustus. According to Munich Universitiy these two styles of adressing an professor allow for a separation between academics and non-academics.
In any case, the more honorable appelation Professor should be written before Doktor or Dr.
In oral communication, as well as in the appelation line of a letter, the Professor scores off the Doktor, so it is ok, to simply say "Herr Professor" without mentioning the Doktor.
As the title Professor is related to an employment as a Professor, special rules apply for retiered people. In most cases they may keep the title, but some institutions demand them to denominate themselfes Emeritus or Prof. Emer.