The UK is ready to fight a war, the head of the armed forces has insisted, after the defence secretary recently suggested the military is not prepared for a conflict.