The IFBB pro or amateur? (they are really two different orgs)
Orgs can't overrule governments, so legalize is the wrong word. In addition performance enhancing drugs are not illegal in much of the world.
Orgs can set rules for their events, and choose how to verify people are following those rules, and what do when people break the rules.
The pro IFBB doesn't test for performance enhancing drugs.
The amateur IFBB kind of tests for drugs in their local, national, regional and world amateur championships.
But then they created the various Arnold Amateurs and Amateur Olympics, specifically for competitors who don't want to enter drug tested contests. No one even pretends those contestants are drug free.