Demonic possession requires surrender of the will by the soul to an evil spiritual being.
Those who have gotten possessed doing yoga, if there are any such souls, were the type of souls who were opening themselves to anything that would feed their egoic desires. The demon takes advantage of this and convinces them to surrender their will to them. They could’ve been practicing Catholics, as many Catholics became possessed over the centuries.
This does not happen because the person is doing Yoga, nor people who are Hindu’s, Buddhist or whatever. It all has to do with the person’s desire for something other than what the tenets of that religion teach.
There have been Catholic Priest, possessed by the devil. Should we avoid Mass because of it ? Of course not. There was more involved for the priest to become possessed and it had more to do with the will and desire which were to feed the false self, i.e. the ego.
If Hinduism is the source of demonic possession, then India must be loaded with them.
Of course such is not the case.
Our desire is union with Christ and as long as that is our desire and our will is union with Him, our souls are protected by Him and Our Blessed Mother.