The Mongol invasion of Vietnam is pretty much summed up by historians as a Mongol failure due to the tropical climate and terrain which caused the Mongols to catch disease. A part of the failure is due to the Vietnamese scorched earth tactics and Tran Hung Dao's great military genius. The former part is considered the main part of the defeat so we will be critiquing that.
The Mongol invasion of Burma in 1277-1287, which is way less popular upon historians is summed up by historians as a victory with the Mongols managing to destroy the great Pagan Empire and break it down into many kingdoms, which wouldn't ever be united for 2 and a half decades until the reign of Bayinnaung.
Even though the Mongols didn't get to conquer Burma, being driven out a decade later, it shattered the Pagan Empire into pieces.
What made it that the Mongols were able to successfully invade and destroy Burma while it couldn't do the same with Vietnam, which is a comparatively smaller nation.
The similarities they have are that that:
However, Burma possessed a greater advantage than the Vietnamese in certain things:
Despite the many advantages the Burmese had over the Vietnamese, how were they so easily defeated while Vietnam couldn't?
I wouldn't say that the Mongols succeeded in Myanmar, per se. War is defined as a continuation of politics. Yuan failed to hold Pagan (except for the northern part) and had to retreat, Kublai Khan failed to achieve his goal of gaining control of the SEA trade route to India, meaning that the Mongols failed to achieve their goals against Pagan. After the invasion, Pagan eventually fell into a state of civil wars, but the root causes were that 1) Myanmar was never very unified in the first place, even now in the modern day, 2) Myanmar has always been and still is more ethnically diverse than northern Vietnam, 3) the Tai-Shan people's rise to power, as in Lan Xang, Lanna, and Siam. The Mongols might have accelerated the process of civil war, but they neither achieved their goals nor were the root causes of the civil war period.
In contrast to Myanmar, Đại Việt was very united before and after the Mongol invasions. Unlike the loose mandala-style government of Pagan, Đại Việt at the time of the Trần dynasty had a Chinese-style Buddhist-Confucian authoritarian central government with a heavy dash of family-run militarism and feudalism, with a large national professional army and several private armies of the Trần princes in their country estates scattered around the country. Furthermore, the central government in the low land had had a very long history of cooperation with the Tai people in the northern upland since at least the 10th century. In 938, the Tai, Mường, and Việt people were recorded to have entered an alliance for independence against Tang and Southern Han. The Mường and Việt people themselves are heavily mixed with the Tai through their Âu Việt ancestors despite not speaking Tai language. During the Lý dynasty, the Lý government was recorded to reaffirm official alliance with the Tai people in the northern upland, sponsoring southern Tai rebellions in Guangxi against the combined Song - Northern Zhuang force, and receiving Tai refugees from Tai allies when they lost. During the Trần dynasty, familial relations between the Trần royal family and the leaders of the Tai and Mường groups in the upland were established through the years and were reaffirmed again specifically in anticipation of the Mongol invasions. As a result, instead of being a potential threat against the resistance efforts against the Mongols like the Tai-Shan in Myanmar, the Tai and Mường people in the northern upland actively contributed to the guerilla warfare tactic of Đại Việt against the Mongols.
In addition to better organization, relatively homogeneous population, and unity, another advantage that Đại Việt had over the Myanmar was that the Đại Việt had access to the sea and had been known to take the battle to naval warfare for 2 out of 3 Mongol invasions. Song expertise or not, the Mongols weren't particularly known for their seafaring capacity, but Đại Việt was. Naval warfare proficiency and guerilla tactic gave Đại Việt the capacity to pick the battlefield and when to engage, which might have led to less destruction on land and generally less chaos post-war.