Well they did in 1950 during the Korean War. That war was called a U.N. "police action" and had the approval of the U.N. Security Council. That didn't stop the Chinese from pouring over the northern border of Korea when MacArthur had pretty much defeated the NK army. Regardless though, if NK felt its existence was threatened they would likely launch nuclear weapons. So this would not be a conventional war. That's why it's in everyone's interest not to let this become a war.
I really dont think the Chinese would do that this time. The circumstances are a little different. I don't foresee a war anyway. North Korea's leader has delusions of godhood, but he's not a complete idiot. He's just trying to get attention. We should be prepared, but it's unlikely that he will actually go to war with us. His father did the same thing.