You can get allied during a war, not with your opponents though. There is a -1000 against accepting alliance invitations from people who are at war, but if someone at peace sends an alliance invitation to someone at war, they can very well accept it. But in any case they should not be able to ally someone they are at war with and I'd like to see some screenshots of this happening, please.