Use of a property which belongs to a dead person...
Use of a property which belongs to a dead person, who has not paid Zakat (alms) or owes a debt, is allowed with the permission of the heirs, provided that such a use does not in any way prevent from obligations. So a person wishing to pray in such property can do so, with the permission of the heirs.
If some of the heirs of a dead person are either minor, or insane, or absent, then use of that property without permission of the guardian of those heirs, is Halal (allowed), and it is not permissible to offer prayers in it. But usual uses, which are made in order to perpare the dead body for burying, will be in order. The second condition: The place for obligatory prayers should not have such a vigorous movement which would make normal standng, Ruku or Sajdah impossible.
In fact, as an obligatory precaution, it should not prevent the body from begin at ease. But if one is forced to pray at such places, due to shortage of time, or any other reason, like in a car, on a ship or on train, the one should try to remain still, and to maintain the direction of Qiblah, as much as possible. And if the vehicles move away from the direction, he should return to Qiblah.
If maintaining the exact direction of Qiblah is not possible, then one should try to keep the deviation in an angle less than go degrees, and if this again is impossible, he should keep the direction of Qiblah only while offering Takbirat-ul-iharm. But if this is not impossible either, considering the direction of Qiblah will be not necessary. There is no harm in offering prayers in a car or a boat, or on railway train or other vehicles, while they are motionless.
And if they do not cause excessive swaying to the body when they are in motion, one can pray in them in motion. The third condition: The ceiling of the place where one prays should not be so low, that one may not be able to stand erect, nor should the place be so small, that there may be no room for performing Ruku or Sajdah.
The fourth condition: If the place where one wishes to pray is Najis, it should not be so wet that its moisture would reach the body or the dress of the person praying, provided that the Najasah is of that kind which invalidates the prayer. But, if the place where one places one's forehead while performing Sajdah, is Najis, the prayer will be void, even if that place is dry. The fifth condition: As an obligatory precaution, women should stand behind men while praying.