Its done using the map command of #allies X Y where X and Y are the nation numbers for the nations to be allied.
http://www.dom3minions.com/docs/nations.txt
The vsAI games that you are referring to
http://www.dom3minions.com/HostedGames.htm
create a randomly generated map for each game and add those commands to the end of the .map file for the nations that were selected to be put in as AI players
Yes you can do it locally. And you can create teams of AIs. In fact, one of the later games (Chaos games, not recommended for new players) uses two AI teams. The same randomly selected 3 nations are allied to not attack each other. And another team of two Indept nations are allied to each other.
If you create multiple AI teams and want to watch things, you can use the unlisted --comptrn switch to create turn files for the AIs that you can pick up and look at as if they were yours. (you cant change their actions but you can look at what they are doing)