Drug are not universally forbidden. Any drug that is normally controlled in the country you're going to is only allowed in if you meet the controls. Some human medicine is sold "over the counter" (that is, without controls) - aspirin, for example. You can freely bring that into another country where it is also sold freely. Others are controlled in some way - only sold to those with a prescription, for example. When you bring such drugs in, you need to have the prescription and it needs to be for you. Part of the control process is that you're not just allowed to bring, say, heart medicine for another person it wasn't prescribed to.
Vet medicines are typically far less controlled. So by labelling or just saying the medicines were for an animal, he was saying they were in a less controlled category. He could have said they were aspirin and if they looked like it, he might have got away with that. Of course, if anyone tested and became aware he was lying, he would have a much bigger problem. That's why it's a good movie scene, because it establishes a character as a confident liar and a risk taker who gets away with things.
It's not a recommended strategy for real people, especially ones who don't know the appearance of the medication they are pretending to carry.