Russia's invasion of Ukraine and wider threats to the UK and its allies share "a lot of similarities" with the three-year run-up to the Second World War, the armed forces minister has said.