This occurs informally (i.e. without binding contracts) but sometimes with great sophistication in the United Kingdom, mainly between The Labour Party and the Liberal Democrats (UK). For example, in an election, there may be one district in which the Labour Party and the Conservative Party candidate are running in a tight race, with the Liberal Democrat far behind. In another district, the Liberal Democrat and Conservative candidates may be in a tight race, with the Labour candidate far behind. Here, a Liberal Democrat voter in the first district would agree to vote for the Labour candidate in exchange for a Labour voter from the second district voting for the Liberal Democrat candidate.
This has also been suggested as a strategy for the U.S. presidential election, with voters from "safe" states voting for third-party candidates, and voters from states with contested races voting for the second-preference candidate of the voters from the third-party.