This expression describes the state of a person in the morning, after increased libation, when the unfortunate person has a hangover syndrome, which is accompanied by inflammation of the mucous membrane of the esophagus. The list of symptoms includes a burning sensation in the stomach, often heartburn and dry mouth. And since the esophagus really resembles the shape of a pipe, the sensations can be described as burning a pipe.
Although, there are more exotic assumptions, such as this: the expression is associated with a "closed cycle" of steel production. The blast furnace continues to operate, but there is nothing in the chimney, i.e. ore and coal were not added in time. This comparison is similar to the state of withdrawal (withdrawal) in an alcoholic, when a friend wants to take a dose of alcohol to alleviate the condition.