My first real post! Woot!
At the Mardi Gras in Sydney, there's usually quite a high dog presence, and many people I know have wandered through, past and even stopped to pat the dogs after being near people smoking cannabis
and doing other naughties without so much as a second glance - While I would never advocate taking any kind of illegal substance anywhere, I've heard tales that the best thing to do is to seal it in an airtight bag many many days before you intend on taking it, and try to avoid getting anything similar on your person to minimise the amount of primary substance on your skin.
It would be unwise carry trafficable amounts (just in case), and most of all, be relaxed and confident. Dogs are not only trained to smell drugs
and sit (which is how police know you've been caught) but also to smell hormones we release when afraid... and quite possibly to respond to their masters commands, one of which may be to follow you if you look shifty (as dubious legally as that may be)
At the end of the day, if you do something like that, you are taking a risk and people do get caught, however you're not going to be the only one, and if you walk quickly and with confidence past the dogs, it's unlikely they'll smell you out of the crowd, but stranger things have happened.