Are political concessions as quid pro quo for candidate dropping out possible/used in US primaries?

This is a factual question but specfically about elections, and answers will involve opinions - so, if it’s not in the correct forum here, please move.

Some candidacies in US presidential primaries obviously don’t expect to win the nomination and the election, even as a long shot. Rather they seem to be about promoting debate about some issues, or about making the candidate nationally visible for future political purposes.

The Sanders campaign would be an example for the former case (issues), at least before unexpected successes temporarily made him a real contender.

My question: Can a primary candidate who really only wants to drive policies rather than win office exchange their outsider chance (or, absent even an outsider chance, their nuisance value) for political concessions from a candidate they drop out in favour of?

Can candidates A and B make a deal on the lines of “Candidate A drops out and endorses candidate B; in return candidate B undertakes to promote policy X, make appointment Y and veto legislation Z if elected”?

Of course this would not be legally enforceable, the threat would be the political one of having broken their word to A and A’s supporters.

Are there legal pitfalls?
Has such a compromise deal ever been made?

That sort of thing is “business as usual” in Washington DC!

Absolutely. This kind of bargaining is commonplace and expected. You’ve already seen it in this cycle, with Clinton being pulled to the left in several issues in response to Sanders’ endorsement.

More legally dubious, but still done sometimes, is an administration appointment in exchange for dropping out or an endorsement. There is a statute which disallows it (difficult to look up on my phone right now) but in practice it’s impossible to enforce.