Nothing is impossible - it all depends upon the strength of the evidence - the testimony of the witnesses - and the skill and legal maneuverings of the defense and prosecution attorneys. In other...
There are test which will specify the type of drug one has taken. Some simply say the category of drug taken. If you are looking for a specific drug, a test can definitely be done