I'm pretty sure that your fears are based on paranoia plus the fact that, although unlikely, your fear is a possibility rather than a deluded impossibility
If your dog keeps vomiting or shows any other signs of illness, take him straight to the vet. I don't know this for a fact, but I'm pretty certain that if bloods are taken from a pet at the vet's, that they will be testing for certain things & won't be drug-testing your dog.
I don't think drugs just 'show up' unless they are specifically being tested for
Eating grass & then throwing it up is normal for cats & dogs - as long as it's just grass in a little bile that they bring up. (I always thought they did it to give their stomachs a clean out, but just got sucked into a whole ream of Google theories seeing if I was right - you can do that too!)
Hopefully, both the pets are absolutely fine and that this scare has made you shut them out of the room you're preparing & partaking in, then clean any away any traces, unless it's a pill that you can just swallow
I don't do any drug preps in the same room as my pets as I'm worried about them knocking over something and/or ingesting it in the process. My pets aren't allowed in my bedroom, so any drugs that are smoked are done there too.
When we're doing tweaky drugs, we don't want our pets tweaking too!
Anyway, they're probably fine, but if they show any physical symptoms of being unwell, just take them to the bloody vet & don't sort your drugs out in the same room again