What is the difference between 'roof' and 'canopy'?
Typically, a canopy is used to provide shade while a roof offers more solid protection; canopies filter and roofs protect. You often hear 'canopy' used to describe the sky-ward protection you experience in a forest or jungle--basically only shade and maybe a little protection from rain. A cave would offer roof-like protection--shade, protection from rain, and protection from big, hard, nasty things that fall from the sky.
These pseudo definitions could be applied to earth's atmosphere in a similar way. Ask, "Does the atmosphere provide a shade-like protection against things from outer space, or does it offer more solid protection?" I think for most of the big, hard, nasty things that fall from outer space that our atmosphere is only a canopy, but if you are specifically talking about types of radiation that our atmosphere completely reflects or absorbs you could claim that our atmosphere (or sky) is a roof.
Though both refer to some sort of surface above something, I think they are distinct in terms of structural support. That is, a roof is generally a rigid object held in place, while a canopy is looser and hangs above something.
For example, big-tops and forests have canopies while houses and caves have roofs.
In both cases I think the words are acceptable for poetic usage.
"He slept beneath the roof of the sky; the canopy of the stars"
The words themselves aren't quite interchangeable. "Canopy" implies a certain level of permeability, whereas "roof" implies a more solid boundary.