Putting crayons into a hot glue gun should not ruin it and you should be able to get the crayon out by adding some glue sticks and then using the glue gun with the glue sticks which should push the crayon reside out.
You could however just buy a cheap glue gun to have just for melting crayons though which is what I did.
I have one glue gun to use with hot glue sticks and then have another hot glue gun just for use with crayons to make art.
Glue guns are not that expensive to have a separate glue gun available just for crayons.
You could potentially ruin your glue gun with crayons so if you don't want to do that then just get a separate glue gun for crayon use.