It partially oxidizes it also.. so it produces CO, and SO2 to some degree.
Its not really a full reaction, and it has side reactions so you can't really right it out.. but the main reaction is just the dehydration of sugar via sulfuric acid producing dilute sulfuric acid, and carbon.
elephant toothpaste uses conc. H2O2 and a catalyst such as KMnO2, MnO2, etc AFAIK.