MI5’s director general has said every terrorist attack is “sickening” during a speech in Washington celebrating the outgoing FBI director.