I bet it would be ok to do. As long as you dont catch it on fire. Or as long as it doesnt get hot enough to melt.
There's nothing wrong if it's made of aluminum. If there's plastic in it (like to make it airtight) you may wanna re-think it. And be aware that certain types of metals (ie. copper) are not safe to smoke out of.
i've smoked out of a ketchup bottle top once.. one of the metal ones on glass bottles... i only did it once.... and it was just to say i smoked out of a kiddie cup bong.. ya know those plastic cups kids get at restraunts... well this dude i worked with at one restraunt could make a bong out of one of them and a ketchup bottle top... worked pretty well if there was absolutely nothing else to smoke out of
If you are talking about what I think you are, you have one of those pipes that you make by putting a hole through the side of the cap, inserting a plastic tube (like from a pen) and covering the bowl part with foil. I used to use one of those contraptions all the time before I got my glass pipe. If that's what you are talking about then it's fine. No more harmful than the weed itself. But I wouldn't put the flame directly on the plastic since it will probably melt.
fuck it, smoke it anyway! just kidding dont listen to that advice because i realize some people on here might actually do it.