It is generally held by many religious people that a lady must not be seen by her brother-in-law. She must observe complete segregation from him. In this regard, if the narrative in which this issue is analyzed, a completely different picture emerges. A typical text of the narrative reads:
عن عُقْبَةَ بن عَامِرٍ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قال إِيَّاكُمْ وَالدُّخُولَ على النِّسَاءِ فقال رَجُلٌ من الْأَنْصَارِ يا رَسُولَ اللَّهِ أَفَرَأَيْتَ الْحَمْوَ قال الْحَمْوُ الْمَوْتُ
‘Uqbah ibn ‘Āmir reports that the Prophet said: “Beware of meeting women in private.” A person from the Ansār inquired: “What is your opinion about the brother-in-law?” He replied: “A brother-in-law is [as lethal as] death [in this matter].”
A simple reading of this narrative shows that it describes a precautionary measure to avoid bringing moral disrepute to a chaste man and woman: The two should not meet in private. Since women tend to be a little careless in the matter of the brother-in-law, a special precaution is sounded in this regard.
In other words, this narrative is not asking women to remain segregated from their brother-in-law. It is only telling men and women to refrain from meeting alone, and in this regard women should be especially careful in meeting their brothers-in-law in private.
Here of course there is a common sense exception. Inter-gender interactions such as between doctors and their patients and teachers and students hinge on a purpose, and as long as the purpose remains dominant, the danger of coming into moral disrepute is warded off.