As a secondary question, what about Italy and Japan?
The only point where Germany could have conceivably quit while they were ahead would have been just prior to the invasion of Poland. At that point German had annexed Austria and most of Czechoslovakia. The international community had accepted these territorial acquisitions. Britain and France had gone to war with Germany because of their invasion of Poland, and Britain would not have made any amicable peace with Germany that did not involve the liberation of Poland.
Germany's only options quitting the war at this point would be to relinquish all post 1939 conquests or decisively defeat Britain and bring them to the negotiating table. After 1941, with the entry of the USSR and USA into the war, decisively defeating Britain became impossible. At Yalta, the Allies agreed that not to make a separate peace with Germany, and the only peace that would be accepted would be the unconditional surrender of Germany.