It would depend on the weight of the denim (some is heavier than others) and the tightness of the the weave of the flannel (some is more threads per inch than others).
It is do-able, but if there is a huge difference in the weight of the two then I would not attempt it. I think eventually the denim would pull the threads of the flannel and the quilt will begin to fall apart.
Just my opinion :)