Rivals are your publicly declared enemies. No, you can't ally with them.
I appropriate that you took time to reply and I respect your decision, but I would still like to say few thinks about it.
Arumba pointed that Bosnia and Serbia are forced to rival each other instead of making alliance and defending against Ottomans.
You could fix this issue by making them historical friends, but this is a situation that happens in every game. Let's say your alliance has lasted over 300 years, they don't have any ae towards you and your relations are hight, but when they're forced to pick a new rival... They pick you because your force limits have grown, the long alliance and wars fought together all for nothing, only because you're almost as strong.
Allying France letting them fight your wars for them is cheap, but what are you supposed to do? You can't ally your neighbours that are as powerful as you because they have rivalled you.
I'm not saying allying rivals should be casual and easy, it should be rare and hard. Just give big penalty for it.
It just bothers me that it is hardcoded block, why isn't it another -1000 penalty? At least At least I could suggest it and be rejected.