You should read the history of the Korean War and why China joined and almost won the war.
I am not sure if the comparison is the same.. China only managed to push that far due to everyone believing they wouldn't intervene at all. Also U.S is much more powerful militarily than the 1950s when it was demilitarizing and considered South Korea to not be that strategic. There is just too much of a difference in military, technological, and economical power alongside leadership for that history to be relevant in discussion today. Only thing one should look at that now is just not to underestimate an enemy and plan for potential consequences.
Those same things that happened then, are nowhere near the same as U.S and SK now.
EDIT:
To others, Iran is not the same as North Korea, with Iran having a much more stable leadership than NK. NK is too unpredictable, giving them the options to blackmail more nations with threats of nuclear war is not bright. NK is literally the only nation that threatens nations with possible nuclear strikes. Israel, Pakistan, India, China, U.S, France, and UK do not not threaten any nation with nuclear first strikes in such a public way.
NK really is the only major threat to U.S. Russia isn't stupid to go into conflict with U.S, it is a rational actor and the same goes for China. Pakistan is the only other nation U.S is concerned about due to it's instability, but U.S would never let it get that far.