Before an opposing Clan has been found, you can cancel the matchmaking by pressing the “Cancel” button.
However, once an opponent has been found, the Clan War can no longer be cancelled. Preparation Day begins immediately. There is no option to forfeit (surrender).