In "We Now Know: Rethinking Cold War History", Gaddis says that Mao acknowledged that Americans might use the atomic bomb against the Chinese, but he thought that China's huge manpower reserves would compensate for that. On the other hand, he also seemed to rely on Soviet nuclear capabilities (which were limited at the time of Chinese intervention in the Korean War, with the Soviets having tested their first atomic bomb in August 1949) as a deterrent against American nuclear use, although this might have been just a tactic intended to downplay the risks in front of his subordinates.
In any case, Mao openly admitted before the Politburo that the USA might use nuclear weapons, but that "we are not afraid, and we just have to get prepared". The Chinese press also ran articles downplaying the capabilities of American atomic weapons and reinforcing the idea of Soviet retaliation.
Source: We Now Know: Rethinking Cold War History, John Lewis Gaddis
China was less enthusiastic about entering into the conflict than they usually are painted as having been. They instead were intent on retaking Taiwan. However, the Soviets were worried that an invasion attempt on Taiwan would result in direct conflict with the U.S. Fleet posted in the area, and that a serious (rather than regional) war could occur.
So, when Kim Il Sung used similar reasoning as the Chinese had for his plans to invade South Korea, the Soviets used it to kind of force China into a corner (and forced them to nominally support invading Korea first).
South Korea was basically viewed as being a less serious risk for a nuclear/large ground war, and the Soviets tried to distance themselves from it to further ensure this. Moreover, MacArthur was clearly ordered to do whatever he could to ensure neither China nor the USSR got too entangled in the conflict (staying away from manchurian interests/ bombing only military encampments etc).
In the 6 week interval before China officially entered the War, the Soviets were basically stunned that the U.S. mobilized so heavily. And the Chinese who were already being backed into a corner/unable to invade Taiwan, saw a potential crisis forming on their southern Border.
In addition, Mao - like the Soviets, thought the U.S. did not want to get too heavily involved in the war and was surprised when the UN Security Council voted down the proposed ceasefire from the Soviets. Despite this, Mao, his supporters, and the Soviets were solidly convinced that the U.S. wanted the war to stay regional and nonnuclear.
Additionally, while Mao only made the decision to Support NK fairly late, he had a lot of factors pushing him to get involved. Stalin is heavily rumored to have sent a cable to the PRC ordering Mao to intervene. And Mao still felt China needed soviet support. Kim il Sung sent top lieutenants asking for China to be the Savior of Eastern Communism. Mao had long since predicted an inescapable regional conflict with the U.S. And China still really wanted to find some way of taking over Taiwan, and saw Korea as a potential opportunity to do so.
When Mao finally decided it was necessary to intervene, he still decided to do so cautiously in order to keep the conflict regional. He called his troops a "volunteer force" In order to avoid declaring war. And did a good deal of maneuvering in order to avoid bringing the Soviets directly into the the war (other than air support- which he was worried the Soviets wouldn't actually provide).
And more concerning than the possibility of nuclear warfare to the leaders of China at the time, (based on the politburo meetings on whether to invade), were domestic issues such as their economy, poor military infrastructure, hundreds of thousands of bandits etc that might take precedence over a foreign war.
tldr; Initially, all involved parties clearly wanted to avoid a World War III. They also felt that as long as precautions were taken, that it would almost definitely be avoided. Mao had already predicted an inevitable conflict with the US, and badly wanted Taiwan. And as the war progressed the situation changed, but China could no longer easily disentangle itself.
"Uncertain Partners: Stalin, Mao and the Korean War" by Goncharov, Lewis and Xue Litai.