I've done it before just to see what would happen...it worked, but not as well as I hoped. Mason jars are made to hold vacuum, not pressure. In other words as the vacuum builds, the lid gets pulled on. As the pressure builds, it pushes the lid out. That translates to an undercarbed beverage. I do, however, use mason jars for transport/gifts of already carbonated beer.
In the end I don't see a whole lot of danger in it more than I do an underwhelming beer.