It’s not a good idea to burn a moldy carpet. Doing so will cause the spores to be released into the air. The spores can then be inhaled and cause severe health issues.