According to Anne Radcliffe's article Mason Jars Are All the Rage But Here's Why You Should NEVER Cook in One at yummymummyclub.ca -- the title alone suggests "no, don't do it"
Essentially, canning jar glass cannot handle the sudden temperature changes found when baking. I'd say that, if used on a stove burner, the temperature changes would be even more sudden, but I'm no expert on that.
Glass expands when heated, like many materials. When it cools, it contracts. Objects that are heating or cooling usually do so unevenly due to a number of factors, including what may be touching it or even just the flow of air around it. But what many people don't know is that this causes the material stress.
To some degree, glass can handle the stress placed on it by heating and cooling, as long as it doesn't happen too rapidly and from extreme hot (such as an oven) or cold (like a freezer). Your glassware doesn't usually break when it comes out of the dishwasher and finishes cooling down in the cupboard... but it will, if you take it fresh out of the dishwasher and put it under the tap for a cold drink. Cracking from the sudden temperature change is called thermal shock.
But there are different types of glass, and different types of glass have different strengths. The different strengths come from how the glass was made and what it was made from.
Pyrex, which is oven-safe, is made of tempered glass--also known as safety glass. But even Pyrex has its limitations, and it is still vulnerable to thermal shock. If you've ever set a hot Pyrex dish on a cold surface, you may have had to duck for cover. Like all safety glass, in conditions that cause it to break, it shatters explosively into many small, blunter - mostly harmless - fragments, designed to help protect you from getting cut badly.
Mason jars are commonly made of annealed glass. When annealed glass fractures, it will shatter into irregular, very sharp pieces and miniature shards. This can cause you minor injury if you're holding it at the time, or it can crack small fragments of glass into your food. You should discard any food or drinks contained in a glass in which a crack has formed. When you use mason jars for canning, you should never pour hot food into a cool jar.