The German legends of Dietrich von Bern are known to us only through literary sources - epic poems about him, the Old Norse Thidrekssaga (itself drawn from German material), mentions of the character in the Nibelungenlied (best known through Wagner's operatic adaptation, in which Dietrich also appears), and a few other sources. But the differences between these, and their distance from the historical characters on whom the legends are very probably based, make it clear that there was a widespread oral mythos surrounding Dietrich long before they were committed to paper.
The legends tell us that Dietrich is the heir to a kingdom in Italy, centered on Bern (Verona), until he is deposed by his uncle Ermenrich. In exile, Dietrich has a great many adventures; in most of the extant material, these are quite fantastical in nature and often include battles with dragons and other beasts of myth. (The episodes themselves often seem to draw on Tyrolean folklore; in some cases parallels are known with stories that are otherwise told about characters other than Dietrich von Bern.) At some point in the process, he arrives at the court of a king named Etzel, and either swears fealty to him or arranges an alliance; Etzel's army then conquers Bern and restores Dietrich to his throne.
Not all of the surviving Dietrich material gives the full history of the principal character's conquest of Italy. The fantastical poems in particular tend not to focus on the geopolitical aspects. For instance, one version that seems to have been quite popular is the twelfth-century epic Laurin. Dietrich, offended because his vassal Witige (a common character in Dietrich legendry) is criticizing him for not having proven his heroism, undertakes a quest to challenge the dwarf Laurin to a fight. Dietrich wins only by stealing and using the dwarf's invisibility cloak. After the battle, Dietrich and his vassals Witige, Hildebrand, and Dietlieb are invited to dine with Laurin in his castle under the mountain, but they are drugged and thrown in the dungeon. With the help of his followers, Dietrich escapes, slays all the dwarfs, and takes Laurin back to Bern to serve as a court jester. The story takes place after Dietrich has been restored to his throne, and the conquest of Italy that is the backbone of the more historical accounts is not even mentioned.
The Scandinavian version, on the other hand, treats Dietrich (here called Thidrek, a Norse cognate) in the usual manner of a saga hero. Unlike the more southerly versions, the action has been relocated to northern Germany, and is geographically quite precise (to the point where specific incidents from the saga can, with care, be matched to real places in Europe; in one case, a story about Thidrek fighting a dragon seems to be set in a town which is in fact known for fossilized dinosaur tracks), indicating a great deal of care on the part of whoever composed it. But despite this relocalization and the abundance of fantastical elements, the main story deals with Thidrek's sojourn in the kingdom of Atil (Etzel), where he finds himself compelled by honor to swear to be one of his host's followers; again, the two conquer Thidrek's home kingdom. The saga version is based on a variety of German material also found in many of the poetic accounts; it comes with a preface identifying it as drawn from "tales of German men." It is quite likely that the same stories that make up the poetry were transmitted orally to the anonymous author of the saga, who retold them in Old Norse and compiled them into a single coherent narrative; whether the localization was the work of the saga author, their sources, or some of both remains unknown. This saga, along with the Völsungasaga (which seems to be close kin to the German Nibelungenlied) was one of Wagner's major sources for the Ring cycle; he even hints at the Thidrekssaga geography by setting much of the action around the Rhine - in the Thidrekssaga a major battle is fought at its mouth, corresponding to the city of Ravenna in the more orthodox geography. (The story of Sigurd the dragon-slayer, known to opera fans as Siegfried, is found in both saga sources as well as in the Nibelungenlied, which Wagner also consulted.)
As consistent as the story is from one version to another (when the overal arc of Dietrich's heroic life is even related; Laurin doesn't bother), none of this ever happened in reality - but it's all based on the adventures of a real king: Theoderic the Great, King of the Goths. The facts of the story have, however, been distorted in the five centuries between Theoderic's death and the earliest Dietrich literature. In the legends, the Ermenrich seems to take his name from the historical Ermenaric, but Ermenaric died nearly a century before Theoderic was even born. Ermenaric seems to fill in for Theoderic's real foe, Odoacer, the Germanic soldier whose ascension to the position of King of Italy in 476 CE marks the end of the Western Roman Empire. Odoacer had not usurped Theoderic's birthright, as the legends claim to strengthen the latter's heroism; the historical Theoderic was a conquerer. Nor was he a contemporary or ally of Attila the Hun, the probable inspiration for the character of Etzel (the name Etzel being a Middle High German form of Attila), though of course Attila did lead an army which sacked an important Italian city. Finally, Theoderic's capital (and Odoacer's) was not Verona but Ravenna. Nonetheless, the vast majority of scholars accept these traditional identifications of the characters, and merely agree that half a millennium is plenty of time for history to fade into inaccurate legend and create the skeleton of the story found in the earliest chronicles which would in subsequent centuries lead to the epics.
There's an alternative theory out there which suggests that a real or legendary king in northern Germany, corresponding directly to the Thidrekssaga geography, is the real origin of the legends, with the Italian geography coming from the confusion of personages with similarly-named people in Roman history. This purports to explain the discrepancy between the dates of the characters under the traditional interpretation, and also give a reason to motivate the two competing locations. Alas for this theory, relocalizing a story or song to more familiar places is a perfectly common part of the folkloric process, and as we've seen many times over on this blog it takes no particular causative factor for a story to become wildly distorted (but still recognizable) over the course of centuries. More devastatingly, the chronicles which mention Theoderic as being connected with Attila in Italy predate the Thidrekssaga by centuries (though it's clear from brief poetic references that the story had made its way north very early), and elements of folklore known to be of southern German origin make their way into the Norse version. It is highly improbable that the Alpine legends postdate the northern versions.
The traditional interpretation, which seems far more probable, is also of great value to the armchair medieval folklorist - it provides us with a perfect, robustly-attested case study in how nearly a thousand years of folk process take a piece of history and turn it first into inaccurate mentions in chronicles, then into legends consistent with those misremembered versions, and from there into fantasies bearing little if any connection to actual historical events, which in turn are passed down into the present day.