The Officer Exchange Program was a program established between the United Federation of Planets and other allied governments in the 24th century as a means of improving understanding and relations between the Federation and other races and cultures. In the exchange program, officers from other fleets would participate in Starfleet operations, and Starfleet officers would visit other fleets in turn. Both the Benzite and Klingon fleets participated in this program with Starfleet.
The Benzite Mendon participated in the program, being assigned to the USS Enterprise-D with the rank of ensign. Despite the difficulties he encountered adapting to Starfleet, Mendon discovered a spaceborne parasitic force that ate away at the hulls of starships, and came up with a solution that saved both the Enterprise and IKS Pagh from destruction. (TNG episode: "A Matter of Honor")
The Klingon government also participated in the officer exchange program on several occasions.
James T. Kirk exchanged with a Klingon who he acknowledged was less bloodthirsty than most others of his time-period. Nevertheless, the two would challenge each other in their later careers (TAS episodes: "The Ambergris Element", "The Counter-Clock Incident")
At about the same time that the Benzite Mendon reported on board the Enterprise, Starfleet felt that it would be a good idea to have an officer serve on board a Klingon ship. When Captain Picard mentioned this to Commander Riker, Riker volunteered for the assignment. Picard contacted Starfleet, and arrangements were made for Riker to serve on the IKS Pagh under command of Captain Kargan. (TNG episode: "A Matter of Honor")
Later Commander Kurn would return the visit by serving on board the Enterprise-D as first officer. Kurn did this in order to meet his older brother Worf, and to bring news to Worf that their father Mogh was facing charges for aiding the Romulans in the destruction of the Khitomer outpost. (TNG episode: "Sins of the Father")
In 2367 another Klingon named J'Dan would participate in the officer exchange program. J'Dan used the program to spy on the Federation for the Romulans. When the warp core on the Enterprise was damaged when the hatch covering exploded, J'Dan was exposed as a spy. J'Dan was returned to the Klingon Empire to stand trial for his actions on board the Enterprise. (TNG episode: "The Drumhead")
In 2383 Ravel Dygan became the first Cardassian to serve on a Starfleet vessel as part of the Officer Exchange Program. He served onboard the USS Enterprise-E. (ST - Typhon Pact novel: Plagues of Night)