There's pretty strong evidence that exercise is good for you and has many health benefits. I feel pretty safe making this claim. We also know that inhaling smoke is bad (how bad, as already mentioned, is yet to be determined). So what to do, if like in my case, your gym has some exposure to smoke? I train in my garage 99% of the time, so I can limit smoke somewhat by keeping the doors closed, but I know it's in there since nothing is airtight. I also have an air filter in the garage, too, which helps. But I can't say for certain that there's no smoke in my garage gym and I operate under the assumption that there is smoke in there.
This is where trade-offs and personal preferences come into play. I look at the AQI reading before I train every day when we're in fire season. For me, if it's above 150 (red on Purple Air), I still might be game if I keep my workout brief. Above 200 and I'll pass. But that's just me.
I think the health benefits that come from exercise outweigh any potential costs related to my brief exposure to smoke in the air (I keep my total time in the garage to under 30 minutes on AQI days between 150 and 200). And let's not forget, most of the warnings related to AQI center around exposure for 24-hour periods. I'm nowhere near that. Let's also not forget that the human body has many systems in place to aid in filtering out toxins (not just inhaled smoke, by the way). Lung issues, by and large, come from high, chronic exposure to lung irritants. The exposure is so great that it overwhelms the body's natural filtering systems. I'd be willing to bet that very few people get lung cancer from smoking a cigar once a year (a perfect example of the dose-response effect).
This stuff is all highly subjective. We have data (the AQI reading). But how we decide our course of action related to that data is highly variable, depending on the risk tolerance of each individual, as well as any risk factors they may have. If you're in a sensitive group (very young, very old, breathing issues), I would suspect (and hope) you'll be a little more cautious in your approach.
There's not a universally correct answer to this question around training in smoky skies. Just the correct answer for you.