Well, first there is the conversation between Ivan and Luffy. Ivan tells Luffy about the war between the marine and Whitebeard, and that both sides wish to controll the world as they want. Then he says that Dragon haven't made his moves yet. Therefore I think it would be smart for Dragon to have one who's in the warlords, to listen to what their plans is and figure out their strenght.
Then there's the speech he came with in marineford. He says there that neither pirates are the right way, neither are the marines. (I'm posting the link to what he says at the end of the post). After that he meets Ivan who's fighting Kuma. And to me it actualy sounded that Ivan and Doflamingo talked in a way that Rivals talk to each other. THey may not like each other, but they're on the same team. Like Sanji and Zoro. He also seemed to know what had happened to Kuma. When we first saw Kuma and Doflamingo they where together, arriving at the meeting to appoint a new warlord.