Technically you should be able to make almost anything you'd be able to make in a metal dish, in a glass dish, but if the preparation calls for one then you can't simply substitute the other willy-nilly. It will likely require a good deal of fine-tuning.
Glass is an insulator. It absorbs heat. That's why solar panels are glass and why having a window in your home is not like having a gaping hole in your wall. As a consequence of this, (a) it will take a longer time for the dish itself to come up to oven temperature, (b) it will cook much more consistently and evenly, even if you have an oven that turns the element on and off to maintain temperature, and (c) it will continue cooking the food after you remove it from the oven, unless you remove the food from the baking dish immediately.
What this means is that you generally have to extend the cooking time by at least 5-10 minutes (more if you are baking at high temperatures) when substituting glass bakeware for metal, to let the dish "pre-heat." Except if you're going to let the food cool inside the baking pan, in which case you might actually need to decrease the overall time to prevent burning afterward. It's hard to be precise because it depends on what you're cooking, how long you're cooking it and at what temperature.
To be honest, I probably would not use a glass dish for any recipe requiring caramelizing because caramelizing relies entirely on finely-controlled conduction; ovens are less sensitive than a stove top but nevertheless, a few minutes too long and it's burnt, a few minutes too short and it's still solid. Better to choose a material that's highly conductive for that, i.e. metal. Glass is best when you need slower, more even cooking, like casseroles.
Smoke is normal in an electric oven, but flames are definitely not.
In order to start a fire, you either need a spark, or you need to heat something beyond its autoignition temperature (AKA kindling point). You might have had a short - or you might actually be using a gas oven with spark ignition - but I'm guessing your issue was the latter.
Cooking oil or grease being heated beyond its autoignition point is one of the most common causes of kitchen fires (grease fires). Supposedly, some oils have autoignition points as low as 550° F (or 288° C), though I'm not sure which oils those are. Olive oil would be my guess as the lowest, but pepperoni grease could very well have ignited at self-cleaning temperatures (which, as you noticed, go up to nearly 1000° F).
Fortunately for you, all modern ovens have a mechanical interlock which prevents them from being opened during a self-cleaning cycle. If you'd opened it, you would have made the problem a lot worse by (a) supplying the fire with abundant oxygen, and (b) drawing all the hot air and flames out of the oven and into your kitchen, quite possibly setting your whole home on fire. Heat wants to move to where it's cold; that's why you keep your doors and windows closed in the winter.
There are a multitude of oven cleaners available for self-cleaning ovens - you are supposed to use these before you run a self-cleaning cycle. Yes, I know it's odd, but "self-cleaning" doesn't really actually mean that it cleans itself, it just gives you a little extra help. You need to try to clear out all the grease and big chunks of food first using one of these cleaners, then run the self-cleaning cycle to deal with anything you might have missed.
Best Answer
It would depend on the type of glass.
If the oven is say 300 F then starting from 40 F (fridge) versus 70 F (room) is not a big difference.
If the glass is oven safe then that 30 F difference should not cause failure.
70 F to 375 F is a bigger difference than 40 F to 300 F.