In the context of this poem, the final line can be read in two ways due to the ambiguous "all" and "they." Little Tom, the chimney sweeper protagonist in this poem has just dreamed of an angel with a "bright key" who has come down to Earth and freed Tom and all his other young friends who are currently in service as chimney sweeps. The angel tells Tom that if he is a good boy, he will eventually go to heaven and have God for his father. As such, Tom himself feels warmed by this dream the next day, and feels that he does not have to fear any earthly harm, as it were, because if he is a "good boy" and does his appointed duties of chimney sweeping, he will eventually reach God, possibly because this line of dangerous work will ensure his early death.
This line can also be read as a caution to those who employ child chimney sweeps. If they did their duty properly, then the chimney sweeps would not have to fear harm. Unfortunately, given the frequently terrible conditions for child laborers at this time, for many the only hope of escape was to die in service as a result of employers failing to do their duty to their workers.