Can someone marry just to stay legaly in a country ??
It is not permissible to marry just to get legal status in a country. Nikah is a sacred bond with specific and defined aims and objectives. If one does not have the intention to fulfil the aims and objectives of Nikah, he/she should not enter into it even for ulterior purposes, for example, obtaining legal status, etc.
There are many un-Islamic factors in that, for example, deception, lies and most important, abuse of women.
and Allah Ta’ala Knows Best
Mufti Ebrahim Desai