Some scholars have said: If it is unlawful because it infringes upon the rights of other people, there is no harm in praying in it, because this is a minor use that custom and common practice ordinarily overlook. (1) We are most likely to think that, if the owner of this garment knew that you had used it because no other garment was available, he would permit it. This is generally the case, if not something known for certain. This view is not far from correct, especially if you know the owner of the garment to be a generous and upright man. In that case, we may say: You are required to pray in it, because in such a case his consent is known.
Or if it is impure, he must repeat the prayer …
His statement, “Or if it is impure, he must repeat the prayer,” means: if he prayed in an impure garment. What is meant by an impure garment is one intrinsically impure, such as the hide of predatory beasts, or one contaminated with impurity that is not excused. If, however, the impurity is of the kind excused, there is no harm in praying in it, such as a small amount of spilled blood.
The evidence that repetition is obligatory has preceded in the discussion of the condition that one’s garment must be pure. (2)
His statement, “he must repeat the prayer,” apparently applies whether he was aware or unaware, remembered or forgot, lacked any alternative or had one available. This is the position of the madhhab; thus, there are six cases.
Their examples are as follows:
1 - He prayed in an impure garment while knowing it was impure and being able to purify it. His prayer is not valid, because he has gone against the command of Allah and His Messenger; therefore, he must repeat the prayer.