Most Chinese characters have been around a lot longer than modern Mandarin, so their phonetic parts often reflect much older pronunciations to the extent that these hints are actually not quite as reliable in modern Mandarin.
Take, for instance, 工, pronounced
gōng in Mandarin; it is used as a phonetic in the characters 江、紅、項, but they are now pronounced
xiàng, respectively, even though their pronunciations were much closer in older varieties of Chinese. Cantonese, for instance, is considered a more phonologically conservative variety of Chinese that preserved more of the rimes from Middle Chinese. As such, 工、江、紅、項 in Cantonese are pronounced more similarly:
hohng (using Yale romanization).
In general, all of the Chinese varieties each have underwent their own set of sound changes. Because sound changes are typically systematic, words that were pronounced similarly tended retain their similarity even as their underlying pronunciations changed so the phonetic parts of characters are often still relevant. However, as shown by the example, sometimes initial slight differences between them could also end up being magnified over time.
Regarding your question about Korean and Japanese, while they are not related to Chinese, they did initially borrow the pronunciations that came with those characters as well when they borrowed the vocabulary from Chinese. In the case of Japanese though, they assigned their own non-Chinese readings to many characters, so any phonetic hints in the original characters would no longer apply to those readings.
The Korean language (to my knowledge at least) used Chinese characters only for Sino-Korean words of Chinese origin, and did not assign non-Chinese readings to them; for this reason, the phonetic hints for Chinese character readings in Korean are still relevant. For instance, according to Wiktionary, the pronunciations of the four example characters above in Korean are
Note that an added complication is that different words may have been imported into Korean and Japanese during differing periods, so their pronunciations will reflect the state and variety of Chinese used at that time. This may also end up making the phonetic hints not as reliable.