When a detector has dirt and dust inside, it will prevent it from working correctly. It can cause false alarms and delays in the detector activating. But worse of all, it could also prevent the detector from working at all.
It’s important then that they are kept clean and well maintained. And sometimes wiping and vacuuming isn’t enough to get it all cleaned out. You should then use a cleaner to ensure it is in good condition.
You may also want to check the functionality of the detectors. It isn’t advisable to simulate those circumstances yourself.
Instead, there are aerosols available to do this safely. Synthetic smoke will test a smoke detector, and a controlled amount of CO is enough to test a carbon monoxide detector.