I've seen crafts making home-made tools, such as on a How To Cook That YouTube video where she replicates a painting set in food. The food representing the paint oil pigment is made into tubes using heavy duty aluminum foil rolled into a cylinder. Then it can be filled and one end crimped, just like the "real thing".
I don't recall how she fitted screw-top lids. Assuming you obtained a lid/stem combo, such as by cutting the top off of an old tube of something, you would have to bond that to the new cylinder to make it one end. If it didn't have to look exactly like a commercial tube, it would be easier to just crimp both ends to seal, and have the stem puncture the tube near one end.
Update: found the video: https://youtu.be/HVdU9LLhfao?t=59
She made a necked-down end of the tube, but did not make screw-on lids. I guess it was served immediately after filling. But seeing how easy it is to form the foil over a form (a pencil in this case) all you need is something like a T-nut but with the threads on the outside. Ever seen the pipe bag tips that are meant to be used with plastic bags? The stem, with a bulbous end, is poked through the bag from the inside and the threaded stem sticks out of the bag.
I can envision something like that which aids in crimping the foil down around it without adhesive by having a ring on the outside that screws down tight against the foil. It's not impossible for a cheap 3-D printer, though the threads would be coarse.
Reclaiming the stems from used products, you could cut out a circle around the stem proper, and form the foil around that. Use epoxy to seal it. Epoxy is generally inert; if it's good enough to fix spoons and dishes and not worry about it, it's good enough for this. Rough up the plastic flange so it has some mechanical tooth to bond to; things generally don't stick to plastic.
Meanwhile, my wife found something similar to that in the "good grips" brand if I recall the package correctly. It's a silicone squeeze bottle with lid, like a ketchup bottle only tiny and very soft so you can squeeze it together quite thoroughly. https://www.amazon.com/OXO-Grips-Silicone-Squeeze-Bottle/dp/B014FYZJ3O/ref=asc_df_B014FYZJ3O
It looks like "condiment" squeeze bottles are widely available in a variety of slightly different styles, so this might serve the purpose you had in mind, at least for some items. I agree that the tube that flattens out can handle things that are less liquid, and you need to get the stem size to suit your need.