Using basic cookies like sugar or ginger bread, not any with filling.
Check out Christina Tosi's book Milk. In it she describes making cakes and cookies from scraps of other desserts. I was inspired by her and made these last year:
Bear claw filling is traditionally made with ground up scraps, usually of cakes or muffins. Sugar cookies and gingerbread are sort of miles apart in terms of texture and moisture. The former will function more like a flour, while the latter is going to impart significant fats and moistness. Let the texture of your final cookie be a guide to you. If, when you pinch a handful together in your fist and it holds together well with no crumbling, you have a good cookie formula. If not, you should probably add an egg or two and mix on a low speed until it holds together. And bear in mind that any leavening action in either original dough has already taken place, so be prepared to add more baking powder and/or baking soda.
It really depends on the recipe: flour has gluten that can be manipulated to give a dish structure. There are certainly a lot of dishes that can use crushed cookies but generally they're not a straight or partial sub for flour.
You can make a tart or pie crust with crushed cookies - e.g., ginger snaps, or chocolate wafers, or shortbread - not a traditional pastry crust, but a graham cracker type.