Green’s Dictionary of Slang

dog n.8

1. a beggar who searches for cigarette ends.

[UK]Partridge DSUE (8th edn) 323/1: C.20.

2. (drugs) the residue of poor-quality opium or heroin.

[US]B. Dai Opium Addiction in Chicago 198: Dog. The residue left from gum when making smoking opium.
[US]‘Boxcar Bertha’ Sister of the Road (1975) 116: The residue, known as the ‘dog,’ consisting of leaves, twigs, and stems from the plants [...] is thrown away.
[US] ‘Sl. of Watts’ in Current Sl. III:2.