Good spirits do not dwell on the earth in any kind of permanent or semi-permanent fashion. Yet there are some isolated cases of dead people either making contact or wanting to make contact with the living realm, and vice versa.
In Jesus’ story of the rich man and Lazarus (from Luke 16:19 – 31), the rich man, after going to hell, wants to return to the earth to warn his brothers not to make the same mistakes he did, but is not allowed to do so. In that story, the rich man is told that there is a “great chasm” separating heaven from hell, but he is not told of a great chasm separating hell from earth, or heaven from earth.
In the book of Revelation, I get the impression that those in heaven may be able to be involved in affairs on the earth according to the will of God. I can’t give you chapter and verse, but I just remember getting that general impression from my last reading of that book. After judgment day, the physical “decaying” (Rom 8:21) creation is destroyed, a new heavens and new earth are formed by God, and there is no longer any involvement in the previous physical realm because a new and perfected physical/spiritual realm has been created. Until then, however, Revelation lets us know that the angels and all the “heavenly host” are very much involved in the affairs of the earth.
I wouldn’t find it impossible to believe that on occasion, to suit God’s purposes, the “faithful departed” (such as Samuel) might also be involved. That doesn’t mean Samuel was roaming the earth in a state of limbo, but may have been allowed to return to earth temporarily to give Saul one last word, since Samuel was about the only person Saul would listen to! God can raise people from the dead. He can certainly also send word through them to the living if He wants to.
Other theories about the Samuel incident include an angel or a demon masquerading as Samuel, which certainly is possible as well.