Certain things called risk factors may increase the risk of developing vaginal cancer. Having a risk factor does not mean you will get cancer. And not having a risk factor does not mean that you will not get it.
Like other cancers, vaginal cancer is not infectious. You cannot catch it or pass it on to other people.