Mattis has sought to reassure NATO allies like Germany that the United States remains committed to the alliance despite comments by President Donald Trump that it is obsolete because it failed to protect Europe against Islamist attacks.