PoD Saigo Takamori gets permission to invade Korea in 1873 using a Samurai Army, basically in order to keep said samurai from attempting to overthrow the Meiji Government.
Basicallly, you have a half feudal, half modern force invade and it does fairly well, until Korea asks for help from either Russia, France or Britain, which it gets, at a cost, both financial and diplomatically such as trade concessions.
In exchange the need to modernize fast is brought home to the Koreans in a most intimate fashion, which they do, adopting a very Meiji like attitude, with slogans Rich nation, Strong Army.
After Saigo's invasion is beaten back, cooler heads prevail in Tokyo. Also, as time goes by, the danger that Korea will become a colony of Russia or Great Britain recedes, the national security danger to Japan recedes. Meiji leaders perceived Korea as a colony to be a dagger pointed at Japan. A Korea modernized enough to fend off colonization is still too weak to invade Japan. Saigo's war being a disaster, curbed Japan of it's imperial ambitions.
In that situation, Korea and Japan working together against unequal treaties makes sense, as does alliance and close cooperation.
The results are two nations working side by side to maintain their independence and essentially more or less equals.
All the Best,
Kerney