During China's Sui Dynasty, Japan's ruler claimed the imperial title for himself, in order to assert their peerage with China. This violated China's Sinocentric cosmology, in which Japan was formerly regarded as an inferior "dwarf". The Sui Emperor was incensed, but the distance between China and Japan meant he couldn't counter it. Japan was thence ruled by their own emperor.
Vietnam also had an imperial title until the early 20th century. How did medieval China react to Vietnam's claim to the imperial title?
I can't speak to Vietnam, but it is worth noting that during the Sui period, the Japanese title tennÅ for Emperor had not yet been developed. While the Empress Suiko addressed herself as tianzi ('child of Heaven') in a piece of diplomatic correspondence, future communications mainly referred to the Japanese monarch as zhu ming le mei yu de, a Middle Chinese transcription of the Japanese title sumeramikoto, a term which allowed the Chinese to interpret it as meaning subordination, while the Japanese could understand it as meaning parity. See this answer for more detail.