All the elements that have ever been created already exist and will always exist in the universe. It is also true that the shape these elements take may be altered and combined in an infinite number of ways to create people, dogs and everything else animate and inanimate. When the combination of elements comprising a physical human being cease to function and the body disintegrates, it’s reasonable to assume that the components may combine in a different way. It is equally conceivable that the new combination of those same elements may become what is often described as a ghost.
The story of stuff: CLICK