You don’t want to use just any glue, however. Make sure the glue is “washable” or specifically for fabric.
“Elmer’s washable school glue is vastly popular with quilters. This can be in liquid form or glue stick; they both work well for a variety of techniques. Specific quilting and sewing glues can be purchased in local quilt stores and online. Adhesive sprays are another type of glue that can be used for quilting, and many like to baste their quilts with spray rather than pins.”
Washable glue will wash out of the fabric completely without leaving any residue when the finished quilt is laundered.
Quilters who swear by glue claim it does not gunk up their machine’s needle. However, if that concerns you keep the glue away from the stitching line. A little glue goes a long way so start with small dots and see how they spread on your fabric.
Also, once the glue is applied and the pieces aligned together, press with a hot iron for a few seconds to dry the glue and prepare it for sewing.
The following article outlines six ways to use glue in quiltmaking. Be sure to read through the comments at the end for more helpful tips.