Yes, perfectly possible - but obviously not through the existing mercenary mechanism. Look at the Client Kingdoms mod for one way of doing it for the player. For non-player factions you would have to do it in a background script using a monitor_event with whatever conditionals you want and a create_unit console command inside.