Neil Woods, who is part of the Law Enforcement Action Partnership (Leap), said corruption has occurred in England and “guaranteed” it would also be happening in Police Scotland.
He said most police officers are incorruptible but a minority can be influenced and believes the issue is “endemic and cannot be defended against” unless drugs policy is reformed to legalise all drugs and remove the drugs market from organised crime.
Speaking at a fringe event at the SNP’s spring conference in Edinburgh, Mr Woods said: “If anyone has been following Line Of Duty and think it is far fetched, well we should be scared.”
The TV drama follows the investigations of an anti-corruption unit in the police.
Mr Woods said the illicit drug market is “destabilising the entire world”.
He added: “There is a less than 1% murder detection rate in Mexico because it’s often the police that are actually doing the murders, because they are employed by the cartels.
“The only way to deal with that is to take the market away from organised crime.
“Now, we may be a long way from Mexico but we are going in that direction.”
He said one police officer he met while undercover was employed by a gangster in Nottingham to join the police and was there for seven years, being paid £2,000 a month on top of his policy salary, with bonuses for providing good information.
He added: “All of the senior police that I’ve spoken to about this topic all agree that this is endemic and you cannot defend against it.
“This corruption is only going to get worse until you change direction.”
He called for all drugs to be legalised and regulated to tackle the problem.
Following the event, he told the Press Association: “Obviously the majority of police officers are untouchable and incorruptible but that minority will always be there and it doesn’t take many.
“I guarantee, absolutely guarantee, that the corruption that I talk about in England and Wales is going to be here in Scotland as well.”
He said there would be local examples of “the gangster who gets away with crimes”.
He added: “It is the nature of the drugs market that this is endemic and impossible to defend against, unless we take the market away from organised crime.”
A spokeswoman for the Scottish Police Authority declined to comment on the claims.
A Police Scotland report submitted to the SPA in December noted in relation to the work of the anti-corruption unit (ACU): “A total of 13 SOCGs (serious organised crime groups) are identified as having an involvement, or markers, in relation to corruption.
“These are rigorously reviewed and allocated to both intelligence and operations ACU staff to monitor and progress as appropriate.
“The threat of infiltration/corruption is heightened by staff use of social media and use of open source resources.
“The social media SOP (standard operating procedure) and force memorandum have been issued reminding staff to protect themselves online.
“In addition, inputs to staff regarding the appropriate and safe use of social media platforms are ongoing.”