Yes having rotten teeth or a rotten tooth can cause bad breath.
The rotten teeth can have bacteria in your mouth that leads to the bad breath.
Even when you have perfect teeth you can still get bad breath as a result of bacteria that harbors in your mouth where you cannot get the bacteria cleaned out by simple teeth brushing.
You can help cure bad breath and get rid of the bacteria in your mouth by gargling with some apple cider vinegar as the apple cider vinegar is antibacterial which can kill the bacteria in your mouth.
Apple cider vinegar is a natural mouth wash that can help prevent tooth decay, bad breath and gum disease.
You can also brush your teeth with apple cider vinegar as well.
Rotten teeth can also lead to gum disease and other health issues so if you have rotten teeth it's best to see a dentist about it for treatment.