Because the German Dunkel is not as well known in the English speaking world as the porter (or stout), I'm going to compare them side by side for you.
First of all, both are in the genre of dark beers. The German word "dunkel" means dark. I'm sure you know already that the dark color in beer comes from the dark-roasted malts used to brew them. A dark roast is given to both the Dunkel and the porter malts, a fact which causes some people to think that they are similar beer styles. But the similarity in name is about where the similarities stop.
The largest difference between the two styles lies in the roasting processes used. Porters and stouts typically use heavily roasted "chocolate" malts that result in a toast-flavored beer. A German Dunkel, like the excellent one from Göller pictured above on the left, uses a Munich Malt.
The Munich Malt (Münchenermalz) is cooked at a lower temperature and for a longer time than the chocolate malt. The usual roast temperature for Munich Malt is between 120-160° F, then it's raised slowly to about 240°F at the very end. The result is a browning effect, but the malts are not burnt or toasted. Munich Malts give out more caramel notes rather than the charcoal notes of the kind you will find in a chocolate malt.
Basically Germans look for a Maillard reaction to occur in the malt, similar to what happens to bread crust during baking, but they pull it out before it gets burnt. By contrast, chocolate malts used for porters will be raised quickly to 450°F and kept for 2 hours at that temperature, until it is charcoal black. Hence the very dark color you see in stouts and porters.
Why do Germans leave their "dark" beer malts undercooked? Part of the reason is so that the malt retains some diastatic power to break down the starches in the grains into simple sugars for fermentation. In other words, the lighter the roast, the more enzymes are preserved for the fermentation process. If you were to completely toast your malt, you would have to use another, lightly roasted, base malt to allow fermentation to happen, essentially using the toasted malt for flavor and color only. The overcooked chocolate malts are incapable on their own of being fermented. The Munich Malt can be used alone because it allows fermentation to happen.
As a result of having only one malt in the brewing process, the Dunkel retains a full-bodied mouthfeel in the final product. The beer also will have a maltier taste, displaying the full flavor of the single crop of barley used in that malt. You get terroir, subtle flavors, and more enjoyment. At least that's what Germans think.
Besides the different malts used, there are other big differences. The yeast that one uses in brewing can make a huge difference in taste. Porters and stouts are ales, while Dunkel is a lager. Ales use top-fermenting yeast while Lagers use bottom-fermenting yeast. Bottom fermentation occurs in cold temperatures over a long period of time, while top fermentation happens at warmer temperatures and moves along much faster. The speed and temperature of the brew results in dramatically different flavors. Ales tend to have bolder, stronger flavors. Most craft brewers in the USA prefer a bold flavor profile such as fruitiness. Lager beers tend to display more subtle flavors, but with more complexity.
The Dunkel from Göller, for example, contains a myriad of subtle caramel and malty notes, besides hints of coffee and chocolate. You taste lots of barley, but not just any barley – the two-row variety grown around the village of Zeil am Main has its own distinct profile. You also will taste nuts, such as roasted almonds and pecans. In fact, you will notice a new flavor every time you sip Göller's Dunkel. It's amazing how much depth it has!
In spite of all the flavors in lager beers, they always remain crushable. Germans believe beer should be easy to drink, and that's why they prefer lagers. After all, why drink only one beer when you can have 3 or 4? Strong ales tend to cause fatigue, while the smooth lager makes you want another. As Franz Josef Göller, the retired father of the current brewers, was fond of saying, "You know a beer is good if you still feel like having another."