Are children's sparklers based on a magnesium reaction?
To answer the question, let us understand sparkler chemistry. A sparkler consists of:


An oxidizer: potassium nitrate or potassium chlorate. They burn off a mixture and are part of oxidation-reduction reaction:
$$
\begin{align}
\ce{\underset{potassium nitrate}{2 KNO3 (s)} &amp;-&gt; \underset{potassium nitrite}{2 KNO2 (s)} + O2 (g)}\\
\ce{\underset{potassium chlorate}{2 KClO3 (s)} &amp;-&gt; \underset{potassium chloride}{2 KCl (s)} + 3 O2 (g)}
\end{align}
$$
Fuel: firework fuel is charcoal and sulfur. Both sulfur and carbon (charcoal) are reducing agents forming sulfur dioxide and carbon dioxide.
Metal powder: aluminum, iron, steel, zinc, magnesium, titanium or ferrotitanium dust or flakes. These metal flakes become incandescent and shine brightly in the presence of oxidizers. If temperatures are high enough, these metal flakes burn. The temperatures of these sparks range from 1800 °F to 3000 °F (1000 °C - 1600 °C)(Ref. I). Many elements heat up and emit at a characteristic wavelength (Ref. II).

A combustible binder: binders hold oxidizers, fuel and metal powders together. Common binders are dextrin (a sugar) dampened by water.
Colorants: aluminium, magnesium and titanium all give near brilliant white sparks. Iron produces orange sparks.


Putting all together: these chemicals are mixed together to form a slurry. The slurry is coated on to wire and allowed to dry. When ignited the metal flakes  aluminum, iron, steel, zinc or magnesium dust or flakes create the bright, shimmering sparks. As to your question, children sparklers are based on metal oxidizing reactions.

References


Ref. I https://www.wired.com/2014/07/the-awesome-physics-in-a-simple-sparkler/
Ref. II https://www.forbes.com/sites/startswithabang/2016/07/01/the-physics-of-fireworks/#3895e0711eee 
http://www.compoundchem.com/2014/11/04/sparklers/
http://www.compoundchem.com/2013/12/30/the-chemistry-of-fireworks/
http://www.compoundchem.com/2014/07/02/the-chemistry-of-gunpowder/
http://www.skylighter.com/fireworks/how-to-make/sizzler-sparklers.asp