I don't see any reason not. My subconsious has created some really cool musical dieas before in non-lucid dreams. The only difficulty would be remembering it when you wake up. Theoretically, if you wake up directly from the lucid dream and go right to your guitar and write it out, it should work.