The easiest solution would be to make them allies from the start, if you want to disable such wars.
Open descr_strat.txt in data/world/maps/campaign/imperial_campaign
Search for faction_relationships to find teh section that handle diplomacy.
Make them allies by changing their stance/create a line for their stance so they become allies.
For example, how to make Dwarves and HE allies (added line in red);
Code:
(...)
faction_relationships scotland, at_war_with venice
faction_relationships moors, allied_with scotland
faction_relationships moors, allied_with egypt
faction_relationships moors, at_war_with slave
faction_relationships moors, at_war_with hre
faction_relationships moors, at_war_with portugal
faction_relationships turks, at_war_with slave
faction_relationships turks, allied_with egypt
faction_relationships egypt, at_war_with slave
faction_relationships egypt, at_war_with hre
faction_relationships egypt, allied_with turks
faction_relationships egypt, allied_with moors
faction_relationships mongols, at_war_with slave
faction_relationships mongols, at_war_with hre
(...)
To know what faction is who in code, check expanded.txt in data/text
EDIT: Delete map.rwm before starting a new campaign and it will apply. Not saved game compatible