The hadeeth that is reported from the Prophet (salallāhu ‘alaihi wasallam) negating contagious diseases is related to what the people of pre-Islamic ignorance used to believe―that a contagious disease itself brings about an effect (and transmits itself from person to person).
As for the Prophet’s (salallāhu ‘alaihi wasallam) prohibition of entering a land which is afflicted by a contagious disease, then that is to act upon a means of protection [from harm]. (See, Al-Jāmi’ fī Fiqhil-‘Allāmah Ibn Bāz, p. 1179-80)
As for leaving a land which has been afflicted by a contagious disease, then Al-Hāfidh Ibn Hajr (died 852H, rahimahullāh) cited the speech of At-Tahāwi who brought a benefit in saying that the Prophet’s (salallāhu ‘alaihi wasallam) prohibition of leaving a place afflicted by a contagious disease is so that it is not said by the people: “He left, so he was saved.” Then Ibn Hajr (rahimahullāh) stated:
“There are three scenarios:
1. The person who leaves an afflicted area purely to flee from it―then he has fallen into that which is prohibited, without any doubt.
2. The one who leaves an afflicted area purely for a need or purpose and not with the intent to flee from the contagious disease at all―this person does not fall into the prohibition.
3. The one for whom a need arises, so he wants to leave to take care of his need, and he combines with that an intent to find relief from staying in the land where there is a contagious disease―and this is a point of dispute… and there has been reported from the Salaf some differing concerning it.“
Bukhāree (5756) and Muslim (2224) report from Anas Ibn Mālik (radiyallāhu ‘anhu) that Allah’s Messenger (salallāhu ‘alaihi wasallam) said:
لاَ عَدْوَى وَلاَ طِيَرَةَ وَيُعْجِبُنِي الْفَأْلُ الصَّالِحُ وَالْفَأْلُ الصَّالِحُ الْكَلِمَةُ الْحَسَنَةُ
“There are no contagious diseases and no evil omen, and I am pleased by a good omen―and a good omen is a good word.”
Shaikh Ibn Bāz (rahimahullāh) stated: Its meaning is to falsify the belief of the people of jāhiliyyah (pre-Islamic ignorance) who held that diseases spread by themselves. So the Prophet (salallāhu ‘alaihi wasallam) informed them that this was falsehood. The One who controls every part of creation is Allah alone. Some of those who were present with the Prophet (salallāhu ‘alaihi wasallam) said: “O Allah’s Messenger, what about the camels which, when in the desert sand look like deers, but when a mangy camel mixes with them they all get infected with mange?” So the Prophet (salallāhu ‘alaihi wasallam) replied,
فَمَنْ أَعْدَى الأَوَّلَ
“Then who brought the disease to the first camel?” Meaning that the One who sent the mange disease to the first camel is the same One who sent it to the others. Then he explained to the Companions that mixing with those afflicted is a means of transferring the disease from a sick person to a healthy person by the permission of Allah. For this reason he (salallāhu ‘alaihi wasallam) said:
لاَ يُورِدُ الْمُمْرِضُ عَلَى الْمُصِحِّ
“A man with sick camels should not let them graze or drink alongside healthy ones.” (Ibn Mājah, no. 3541) or in the context reported by Bukhāri (5771) and Muslim, he said: “The sick one should not be brought to the healthy one.”
This means that it is prohibited to bring the sick, diseased or mangy camel near a healthy camel because this type of mixing may be a cause of transferring the disease from the sick one to the healthy one. For this reason, he (salallāhu ‘alaihi wasallam) said:
وَفِرَّ مِنَ الْمَجْذُومِ كَمَا تَفِرُّ مِنَ الأَسَدِ
“One should flee from the leper as one flees from a lion.” (Bukhari, no. 5707) That is because mixing with the afflicted may be a means of transmitting the disease from one person to another―and it has been established from the Prophet (salallāhu ‘alaihi wasallam) that the transmission of leprosy (or other contagious diseases) from a sick person to a healthy person only occurs by the Will of Allah and His Permission―and it is not something that will definitely happen.
So, in conclusion, the various narrations in this subject prove that there is no contagious disease as was believed by the people in the times of pre-Islamic ignorance who believed (and as many ignorant people believe today) that diseases spread by themselves “naturally”. Rather, the affair is in the Hands of Allah (the Most Perfect)―if He (the Most High) wills, the disease will transmit from the sick person to the healthy person, and if He (the Mighty and Majestic) wills, it will not transmit.
However, the Muslims are commanded to take the means that will benefit them, and keep away from that which may harm them.
Source: من ضمن الأسئلة الموجهة لسماحته من مجلة الدعوة، وقد أجاب عنه سماحته بتاريخ 24/12/1418هـ
Regardless of the position we take in the affairs that are open to the ijtihād of the scholars, the Muslims should always abide by the laws of the Muslim lands and not oppose the rulers except in that which entails clear disobedience to Allah. A Muslim should not put himself or his family in harms-way.
Imām Al-Albāni on Distancing from People and Fearing Contact on Mere Suspicion of Contagious Disease
Al-Imām Al-Albāni (rahimahullāh) said: “I know many doctors who do not shake hands with people fearing that there might be an infectious microbe in the hand of the person. For this reason, they do not shake hands with people–and this is a waswasah, a whispering… the whisper [is normally] restricted to some of the worshippers, but it has passed on to other than the worshippers, to the doctors and their likes…
So the meaning is that this is a whispering which destroys personal ties and human relations that are established between people. The foundation is that every person’s left-overs and interaction with them is that he is upon fiṭrah (original disposition) and upon health and wellbeing.
Thus, when it is established that so-and-so, for example, Allāh forbid, has the disease of tuberculosis and drinks from a vessel, then you can keep away from this, but you should have certain knowledge [beforehand] that he is afflicted with the disease of tuberculosis.
As for a whisper, “maybe he has it, maybe he has it”, then this is not permissible, because this is having an evil opinion about your Muslim brother and secondly, it comprises cutting off ties of brotherhood between you and your Muslim brother.
But when it is verifiably established that he is afflicted [with the disease], then you can take precautions and avoid drinking [from the same vessel] and shaking his hand. This is not from the whisperings and nor is it absence of reliance upon Allāh as is claimed by some people.”