Change Enemy to Ally in Single Player?

You can set teams before you start a random map/deathmatch by clicking [-] so that you are the same number as any or all of the AI. Players on the same number are on the same team.

You can also set diplomacy when you make scenarios, and just start the scenario on default settings.

Once the game is started, it’s almost impossible afaik for enemies to change their mind about diplomacy. Apparently you used to be able to gain a temporary alliance by tribute a large amount of gold, but it didn’t last too long. Usually you’ll be met with “your petty offerings will not sway my determination to crush your empire” message no matter how many resources you tribute.