The UK’s MoD has been pushed into producing a guide to military ranks and their equivalents across the different services. Reports of people referring to senior ranks as “mate” or “boss” might be exaggerated but with an increase in joint operations there is increased potential for embarrassment. Is an Army Captain equivalent to a Navy Captain? No.
Of course this doesn’t explain how you deal with officers from other countries. Maybe NATO has that one covered?