Ask yourself that question. Sitting comfortably in your home vs. behind a steering wheel in high traffic sucking tailpipe fumes through every vent for hours in a seated position wasting upwards of an extra workweek sitting in a car commuting instead of working, while enduring the additional financial and mental stress of spending hundreds more per month on gas and increased insurance rates, and risking your very life doing the most statistically dangerous thing humans do regularly; drive a car.
The mechanism is suspected to be long-term and low level inflammation. That's not generally accepted yet, but at the same time there's no conclusive mechanism for dementia, so the inflammation explanation seems reasonable. Currently.
The problem with your scenario is that it requires people to spend 8 hours inside the home, as opposed to 2 hours commute and 8 hours in an office.
The home might have carpets on which water was spilled a long time ago, and growing mold or bacteria. Bacteria of a certain type that I can't remember ATM, but mold grows in an alkali environment and bacteria grow in acidic, and when one starts it modifies the environment to promote it's own growth.
Also the home might have drywall and paint with anti-fungal chemicals, which prevent fungus except for the types that have evolved resistance to the chemicals, but the fungus sees the chemicals as an attack and generates more spores in response.
Also wooden timbers/joists that get condensation moisture leading to the growth of mold or bacteria.
Also the home might have pets, with associated hair and dander. Also kids, with associated germs and stuff brought in on their clothes.
Also the home owner might not be very conscientious about replacing the furnace filter.
Also the home might be winterized against the cold, and not let in much outside air.
So in summary, the home is considered on average a worse polluting environment than most office buildings. Something like 1 out of 3 home buildings have been tested positive for low level inflammation pollutants of the bacteria and mold types.
You can get your home tested - it involves donning a white glove and passing it over a few surfaces in your house, then sending it out to a lab for analysis.
In this hypothesis, decades of living in an affected home causes low-level inflammation, which results in all sorts of problems, including dementia.
So yes, outside air pollution is a problem, but the pollution in the home is usually much higher and experienced for a much longer time. Office buildings are also worse than outside pollution, but have generally less pollution than the typical home.
And of course, individual examples might be on the extreme in any of the measures, both good and bad.