First of all: Mongols speak a language of the Altaic language family.
Hungarians speak a language of the Uralic family.
Nobody is really sure what language the Huns spoke or its affiliations—many scholars think it was Altaic, but others find evidence for its being related to Yeniseian (a tiny language family spoken in Siberia, now practically extinct). Not enough of Hun or Xiongnu language was recorded for us to identify its family relationship.
As to Ural-Altaic unity: This has been very controversial over the years, and no conclusive yes or no has been arrived at by the linguistic community. In the 19th century, when linguistic relationships were classified by typology, Uralic and Altaic languages were thrown together because they share the “agglutinative” typology. In the 20th century, that was deemed inadequate for classification and the Ural-Altaic hypothesis fell out of favor.
For that matter, the Altaic family itself has been called into question. There is just tantalizingly enough evidence to suggest that the three groups Turkic, Mongolic, and Tungus-Manchu are related, but not enough to establish it firmly.
The Nostratic hypothesis, in which Indo-European, Uralic, Altaic, and some other families are joined in one “macrofamily,” gives a new angle on Ural-Altaic relationship… but this is even more controversial, and has not found widespread acceptance. (Still, if you get a chance to examine the evidence put forward for Nostratic, you may find it persuasive…) One refinement of this idea posits dialects of Nostratic in which the Eastern Nostratic includes Uralic and Altaic. Joseph Greenberg’s Eurasiatic hypothesis is similar to Nostratic but assembles a slightly different set of language families. It still includes both Uralic and Altaic, and includes some more families from Northeast Asia.
One pitfall to be cautioned against in language classification is the binary comparison. I mean, just comparing one language with another and asking “Are the two related?” will probably not bring in much useful data. What works is to compare language families because there the data will be much more complete. That’s why I speak of comparing Uralic and Altaic, not just Hungarian and Mongolian.
If anyone is interested, I have a publication that lists about 20 shared features of Uralic and Altaic that I could cite here.
There is no etymological connection between Hun and Hungarian. Just a coincidental resemblance. The former name is represented by the Chinese Xiongnu, and the latter is from Turkic, from the phrase On Ogur ‘Ten Arrows’, referring to a confederation of steppe tribes in ca. the 9th century. They had been living on the steppes of what is now Ukraine and moved west into the westernmost extension of the steppes, around the river Danube in an area formerly called Pannonia. After they occupied it, it got the name Hungary.
This confederation consisted of seven Magyar tribes and three Turkic tribes. They became all blended over time, so if you go by bloodlines, then you could say the Hungarians have some “Altaic” blood in them. This statement is semi-facetious because language terms like Altaic only refer to language, not race. The two should not be confused. We could say that the Hungarians had some Altaic-speaking ancestors.
There had been Turks inhabiting the area that is now eastern and southern Russia since as far back as the early Christian era, maybe the 4th century. The Volga Bulgar kingdom was thriving in the 8th century in present-day Tatarstan, and the Khazar kingdom appeared in the 9th century. The Volga Bulgars, the Khazars, and the Turkic friends of the Magyars all spoke a highly divergent form of Turkic called r-Turkic which in the present day survives only in Chuvash (in an adjacent part of Russia).
One interesting thing about r-Turkic is that it more closely resembles Mongolian and Tungus-Manchu than regular Turkic. So too does Hungarian. The many Turkic loanwords that the Hungarian language picked up on the steppes are of the r-Turkic variety and thus form a tenuous linguistic connection to Mongolian.