LONDON — British business executives dealing with China were given a formal warning more than a year ago by Britain’s security service, MI5, that Chinese intelligence agencies were engaged in a wide-ranging effort to hack into foreign companies’ computers and to blackmail foreign businesspeople over sexual relationships and other improprieties, according to people familiar with the MI5 document.