It might work, but the oxidizer in sparklers could be KCLO3, KCLO4, or even Barium Nitrate which is really poisonous and water soluble. The other trick is getting the composition to reliably stick to the string. Some compositions require a minimum amount to burn reliably so may not work as well...