Boiling water will kill any live bacteria or viruses that might be in your water. The only thing that can "survive" are bacterial spores. Spores are like seeds or eggs which can hatch to live bacteria. Interestingly, this process is what is used to make salt risen bread...a type of bread leavened by hydrogen-producing bacteria instead of carbon dioxide producing yeast.
The only way to kill spores is the use of a pressure cooker. As another answer mentioned, this does nothing to the chemical dangers, just the biological dangers. If the water is so filthy that you expect there to be actual toxins in the water, purification by RO or distillation is the best bet.
The most significant danger is the super-heated water phenomena. the microwave heats water so gently, that it can actually remain liquid above 100 degrees C. However, the addition of coffee grounds will provide places for steam bubbles to begin to form. The water will then immediately and violently begin to boil, and you could receive some serious burns. If you place a small pinch of coffee into the water while it is in the microwave, it will promote boiling and prevent superheating.