Robots that have reached a certain degree of development indubitably have immortal souls; this is proven with the Spengler phenomenon, as well as the fact that there are robots in Valhalla. And we saw in The Revolution Will Be Televised that a human ghost can possess a non-human; I expect that it's a soul-to-soul thing, rather than a function of their meat.
My hypothesis is that sapient robots can be possessed, but they have to be intelligent enough that they could become free citizens by the standards of the Federation.