The two countries, which criminalize homosexuality and impose severe punishments for it, were picked to play on a day celebrating L.G.B.T.Q. communities.