What if Joseon Korea had defeated the Manchu invasion?
LOL! Manchus had defeated Ming and Joseon allied forces at the famous battle of Sarhu Lake back in 1619, despite being reported only a half, some reports say one third, of Ming and Joseon allied forces. This was the beginning of the end of Ming empire. Although Ming would fight on for many decades, Ming would never recover to defeat the rising power of Manchus. Ming had saved Joseon from complete annexation by Toyotomi's Japanese invasion from 1592 to 1598. So Joseon basically relied on Ming for military support.
When Manchus under Hongtaici or Qing Taizong, invaded Joseon Korea in 1636( second invasion after the first in 1627), Manchu cavalry, estimated around 100,000, successfully crossed the frozen Yalu River on December 10th and reached Gaesong (present day border city between South and North Korea) on December 14th. Blitzkrieg on steroids!
Hongtaici, the second emperor of Manchus and Taizong of Qing Dynasty.
It is unlikely it would've made much of a difference. To begin with, the Manchu Invasions against Joseon Korea were not for conquest. They were merely to put Korea, an ally of Ming China, out of the fight. Korea was not a real target for the Manchus, mainly because attempting to conquer Korea - a mountainous, densely fortified state with relatively few natural resources but a sizable, staunchly independent populace - was not worth the trouble. The Manchus were more interested in conquering the vast, rich lands of China and thereby claim the "Middle Kingdom" for themselves.
Now, had the Koreans successfully defended against the Manchu Invasions, it would have been a huge win for King Injo, but it is unlikely the Koreans would've done much beyond that. While the Manchu attacks did not cause much damage, Korea was still recovering from the devastation of the Japanese invasions just a few decades prior. Much of Korea's farmland had been irreparably destroyed, its royal coffers looted, and many of its finest craftsmen and artisans taken away to Japan. Needless to say, Korea was not in a position to launch an offensive campaign.
That said, however, the mere possibility of a Korean counterattack would have been enough to dissuade the Manchus from expanding too far into the Chinese heartland because doing so would leave their eastern border with Korea exposed. This was a huge reason why, in the 11th century, the Khitans were unable to topple the Song Dynasty and were confined to northern China. At the time, the Khitans also tried to pacify the Koreans first but, unlike their Manchu descendants, failed in spite of their best efforts. The Korean court did verbally agree to sever its ties with Song China, but both the Koreans and Khitans knew full-well that there was no way for the Khitans to actually enforce that agreement. Ultimately, Korea maintained ties with both the Liao and Song Dynasties, leveraging one off of the other to serve its interests. If the Manchus also failed to defeat Korea, I'd say it would've played out much the same way.
Ultimately, however, the Manchus ascended at the time that they did largely because Ming China and Joseon Korea were already in decline. Before the 17th century, the Chinese and Koreans were firmly invested in keeping the Manchus at bay, regularly sending military expeditions into Manchuria, pitting the tribes against each other to keep any of them from growing too powerful, and even making some of the tribes into their tributaries (both China and Korea did this, if you can believe that). But through the 16th century and especially during Japan's invasions of Korea, both states had grown so weak and distracted that the Manchus could coalesce and gain strength without interference. Both Ming and Joseon's defeat, then, was inevitable.
And how could they do it?
The strength of the Joseon for this lacked. Japan is the enemy.
Defeat is inevitable.
Korea did not preach any enemy, because she never knew how to find allies. But only those whom they used for their own purposes.
For example, Anchun - the empire was formed by protomanchurs only through an alliance with the Tanguts. Otherwise, the Khitan would have ruled further.
The ally of Goguryeo was Yamato. And before the formation of the Turkic Kaganate everything was fine.
Silla and his successors could not find a common language with their neighbors, but only always relied on the patronage of China. But when China waned ....