Is It Permissible to Slaughter the Hadiy Outside the Haram?
Question

Is it permissible to slaughter the hadiy outside the Haram and distribute its meat to the poor in the pilgrim’s country, because there are many poor people in their country?
What is the ruling on Hajj if the pilgrim does that? 
I hope that you will give evidence from the Quran and Sunnah for it being obligatory to slaughter the hadiy and the place where it is to be slaughtered.
Why should the hadiy be slaughtered only within the boundary of the Haram?
Praise be to Allah.Types of hadiy
The sacrifices that must be offered by the pilgrim during his Hajj are of different types:

The hadiy of tamattu` and qiran

Whoever does Hajj tamattu` (entering ihram for `Umrah, then exiting ihram, then entering ihram for Hajj) or qiran (entering ihram for `Umrah and Hajj, and remaining in ihram until all rituals have been completed) must offer a hadiy if he can afford it, otherwise he must fast instead of that. Allah, may He be exalted, says (interpretation of the meaning):
“Then if you are in safety and whosoever performs the `Umrah in the months of Hajj, before (performing) the Hajj, (i.e. Hajj-At-Tamattu` and Al-Qiran), he must slaughter a Hadiy such as he can afford, but if he cannot afford it, he should observe Saum (fasts) three days during the Hajj and seven days after his return (to his home), making ten days in all. This is for him whose family is not present at Al-Masjid-Al-Haram (i.e. non-resident of Makkah). And fear Allah much and know that Allah is Severe in punishment.”  [Al-Baqarah 2:196]
Ibn Kathir (may Allah have mercy on him) said:
“…that is, if you are able to perform the rituals of Hajj, then whoever among you is doing `Umrah before Hajj – which includes those who enter ihram for both `Umrah and Hajj (i.e., qiran) and those who enter ihram for `Umrah first, then after finishing `Umrah [and exiting ihram] they enter ihram for Hajj, which is tamattu`, “he must slaughter a Hady such as he can afford” that is, let him offer whatever hadiy he can afford; the minimum that may be offered is a sheep.” (Tafseer Ibn Kathir, 1/537)
The place where this sacrifice is to be offered is the Haram of Makkah .
Ibn Al-‘Arabi (may Allah have mercy on him) said:
“There is no difference of scholarly opinion concerning the fact that the hadiy must be slaughtered in the Haram .” (Ahkam Al-Quran, 2/186)
It says in Al-Mawsu‘ah Al-Fiqhiyyah (42/250-251):
“The jurists unanimously agreed that the permissibility of shedding the blood of the hadiy – except in the case of one who is prevented from completing Hajj – is limited to the Haram, and it is not permissible to slaughter the sacrifice outside the sanctuary, because Allah, may He be exalted, says concerning the penalty for hunting (within the boundary of the Haram): “the penalty is an offering, brought to the Ka`bah” [Al-Ma’idah 5:95]; and He says (interpretation of the meaning): “and afterwards they are brought for sacrifice unto the ancient House (the Haram - sacred territory of Makkah)” [Al-Hajj 22:33]. And the Prophet (blessings and peace of Allah be upon him) said: “I offered my sacrifice here, but all of Mina is the place of sacrifice, so offer your sacrifices in your camps.” And he (blessings and peace of Allah be upon him) said: “Every ravine of Makkah is a road and a place of sacrifice.” 
What must be done with the meat of the sacrifice is to distribute it to the poor and needy of the sanctuary; it is permissible to take a little of it outside of the Haram zone to eat or give as a gift.
Jabir ibn ‘Abdullah (may Allah be pleased with him) said: We used not to eat the sacrificial meat for more than three days in Mina, then the Messenger of Allah (blessings and peace of Allah be upon him) granted us a concession and said: “Eat and store (for the journey).” So we ate some of it and stored some (for the journey).  (Narrated by Al-Bukhari, 1719, and Muslim, 1972)
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said:
“The hadiy of tamattu` and qiran is a sacrifice of gratitude, so it does not all have to be given to the poor of the Haram. Rather it comes under the same ruling as the udhiyah, i.e., the one who offers the sacrifice may eat some of it, give some as gifts and give some in charity to the poor of the Haram.
If a person slaughters the hadiy of tamattu` or qiran in Makkah, then he takes the meat to Ash-Shara‘i’, or to Jeddah or elsewhere, there is nothing wrong with that, but he must give some of it in charity to the poor of the Haram.” (Al-Sharh Al-Mumti‘, 7/203)

Sacrifices offered (as a penalty) for omitting an obligatory part of Hajj

Whoever omits one of the obligatory parts of Hajj has to make up for this shortcoming by sacrificing a sheep.
It was narrated that `Abdullah ibn `Abbas (may Allah be pleased with him) said: Whoever forgets any of the rituals [of Hajj] or fails to do it, let him offer a sacrifice. (Narrated by Imam Malik in Al-Muwatta’, 1583)
This sacrifice must be offered in the Haram and its meat must also be distributed in the Haram.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said:
“The scholars stated this. They said: The hadiy of tamattu` and qiran, and the hadiy that is required for omitting an obligatory part of Hajj, must be slaughtered in Makkah. Allah has also stated that with regard to the penalty for hunting (within the boundary of the sanctuary), as He says (interpretation of the meaning):
“O you who believe! Kill not game while you are in a state of Ihram for Hajj or Umrah, and whosoever of you kills it intentionally, the penalty is an offering, brought to the Ka`bah.” [Al-Ma’idah 5:95]
With regard to that which Islamic teaching restricts to specific places, it is not permissible to move it elsewhere; rather it must be done in the place specified. So the hadiy must be slaughtered in Makkah and its meat must be distributed in Makkah.” (Majmu‘ Fatawa Ibn ‘Uthaymin, 25/83)

Sacrifice offered because of the pilgrim doing one of the things that are prohibited whilst in ihram

With regard to doing things that are prohibited, it is proven in the Quranic text that a sacrifice must be offered in compensation. Allah, may He be exalted, says (interpretation of the meaning):
“And perform properly (i.e. all the ceremonies according to the ways of Prophet Muhammad (blessings and peace of Allah be upon him)), the Hajj and Umrah (i.e. the Hajj to Makkah) for Allah. But if you are prevented (from completing them), sacrifice a Hadiy (animal, i.e. a sheep, a cow, or a camel, etc.) such as you can afford, and do not shave your heads until the Hadiy reaches the place of sacrifice. And whosoever of you is ill or has an ailment in his scalp (necessitating shaving), he must pay a Fidyah (ransom) of either observing Saum (fasts) (three days) or giving Sadaqah (charity - feeding six poor persons) or offering sacrifice (one sheep).” [Al-Baqarah 2:196] (See: Al-Jami‘ li Ahkam Al-Quran by Al-Qurtubi (3/292-293)
If he has to offer a sacrifice, then he has the choice between slaughtering it and distributing its meat in the place where he did the prohibited action – whether that place was within the Haram boundary or not – or slaughtering it and distributing its meat in the Haram.
It was narrated from Ka‘b ibn ‘Ujrah (may Allah be pleased with him) that the Messenger of Allah (blessings and peace of Allah be upon him) saw him with lice falling on his face and said: “Are these vermin bothering you?” He said: Yes. So he instructed him to shave his head when he was in al-Hudaybiyah, and it was not yet clear to them that they would exit ihram there, as they were still hoping to enter Makkah. Then Allah revealed (the verse containing the ruling on) fidyah, so the Messenger of Allah (blessings and peace of Allah be upon him) instructed him to give a faraq (three saa‘s) to be shared between six poor persons, or to sacrifice a sheep, or to fast for three days. (Narrated by Al-Bukhari (1817) and Muslim (1201).
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) said:
“Whatever it is permissible to sacrifice and distribute outside of the Haram, when there is a reason to do so, it is also permissible to sacrifice and distribute inside the Haram, but the converse is not the case.” (Ash-Sharh Al-Mumti‘ (7/204)
That also includes the camel which a muhrim must sacrifice if he has intercourse with his wife before the first stage of exiting ihram.
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) said:
“If the prohibited act is intercourse before the first stage of exiting ihram in Hajj, then what he must do is sacrifice a camel, to be slaughtered in the place where the prohibited act was committed, or in Makkah, and its meat is to be distributed to the poor.” (Majmu‘ Fatawa Ibn ‘Uthaymin (22/222)

Sacrifice offered because of being prevented from completing one’s Hajj

Allah, may He be exalted, says (interpretation of the meaning):
“And perform properly (i.e. all the ceremonies according to the ways of Prophet Muhammad (blessings and peace of Allah be upon him)), the Hajj and ‘Umrah (i.e. the Hajj to Makkah) for Allah. But if you are prevented (from completing them), sacrifice a Hadiy (animal, i.e. a sheep, a cow, or a camel, etc.) such as you can afford.” [Al-Baqarah 2:196]
The ruling is similar to the ruling on the type mentioned above; he should offer his sacrifice in the place where he was prevented from continuing, because when the Prophet (blessings and peace of Allah be upon him) was prevented from entering Makkah at the time of al-Hudaybiyah, he offered his sacrifice outside of the Haram zone.
It is also permissible to slaughter it and distribute the meat inside the Haram zone.
It was narrated from Ibn ‘Umar (may Allah be pleased with him) that the Messenger of Allah (blessings and peace of Allah be upon him) set out for `Umrah, but the disbelievers of Quraysh prevented him from reaching the Ka`bah, so he slaughtered his sacrifice and shaved his head in al-Hudaybiyah. (Narrated by Al-Bukhari (4252)
Ibn Hajar (may Allah have mercy on him) said:
“The apparent meaning of the story is that most of them offered their sacrifices in the place where they were, which was outside the boundary of the Haram, which indicates that doing that is permissible. And Allah knows best.” (Fath Al-Bari, 4/11)

Sacrifices offered as compensation for hunting game

This must be slaughtered and the meat distributed within the Haram zone, and it is not valid if done outside the Haram zone.
Allah, may He be exalted, says (interpretation of the meaning):
“O you who believe! Kill not game while you are in a state of Ihram for Hajj or ‘Umrah (Hajj), and whosoever of you kills it intentionally, the penalty is an offering, brought to the Ka`bah, of an eatable animal (i.e. sheep, goat, cow, etc.) equivalent to the one he killed, as adjudged by two just men among you; or, for expiation, he should feed Masakin (poor persons), or its equivalent in Saum (fasting), that he may taste the heaviness (punishment) of his deed. Allah has forgiven what is past, but whosoever commits it again, Allah will take retribution from him. And Allah is AllMighty, All-Able of Retribution.” [Al-Ma’idah 5:95]
Ibn Kathir (may Allah have mercy on him) said:
“The words “an offering, brought to the Ka`bah” mean that it should reach the Ka`bah; what is meant is that it should reach the Haram by being slaughtered there, and its meat distributed among the poor of the Haram. This is a matter concerning which there is consensus.” (Tafsir Ibn Kathir (3/194)
From the above it is clear that where it is prescribed to slaughter the sacrifice inside the Haram zone, it is not permissible to slaughter it outside that zone. But in cases where it is prescribed to slaughter it outside the Haram zone, it is permissible to bring it and slaughter it inside the Haram zone.
If a person performs his Hajj and rituals properly, but he slaughters the hadiy outside the Haram zone, his Hajj is valid, but he must offer another hadiy instead, inside the Haram zone. If he is not able to go back to Makkah himself, then he may appoint someone whom he trusts to sacrifice it on his behalf inside the Haram zone.
Shaykh Ibn Baz (may Allah have mercy on him) said:
“With regard to the hadiy of the one who is doing tamattu` or qiran, it is not permissible to slaughter it anywhere but within the Haram zone; if he slaughters it elsewhere, such as in ‘Arafah or Jeddah or anywhere else, that is not valid, even if he distributes its meat in the Haram, and he has to offer another hadiy, to be slaughtered within the Haram zone, whether he was ignorant of the ruling or was aware of it, because the Prophet (blessings and peace of Allah be upon him) slaughtered his hadiy in the Haram zone, and he said: “Learn from me your rituals of Hajj.” Similarly, his Companions (may Allah be pleased with them) only slaughtered their hadiys in the Haram zone, following his example (blessings and peace of Allah be upon him).” (Majmu‘ Fatawa Ibn Baz (18/31-32)
Why should the hadiy be slaughtered only within the boundary of the Haram? 
The hadiy should be slaughtered within the boundary of the Haram for the following reasons:

Because this is what is prescribed by the Quran and Sunnah, and it is obligatory to follow them.

Allah, may He be exalted, says (interpretation of the meaning):
“It is not for a believer, man or woman, when Allah and His Messenger have decreed a matter that they should have any option in their decision. And whoever disobeys Allah and His Messenger, he has indeed strayed in a plain error.” [Al-Ahzab 33:36]
“And whatsoever the Messenger (Muhammad-peace and blessings be upon him) gives you, take it, and whatsoever he forbids you, abstain (from it) , and fear Allah. Verily, Allah is Severe in punishment.” [Al-Hashr 59:7]
The issue with regard to these sacrifices is the same as that of all the rituals of Hajj, and indeed it is the issue with regard to all acts of worship: one should follow the command of Allah and His Messenger (peace and blessings be upon him) with regard to that, without asking why.
Al-Bukhari (315) and Muslim (335) narrated from `Aishah that she rebuked someone who asked her, Why does a menstruating woman have to make up missed fasts but not missed prayers? She said: That used to happen to us and we were commanded to make up the fasts but we were not commanded to make up the prayers.
Ash-Shatibi (may Allah have mercy on him) said:
“With regard to matters of worship, what is required is to follow the instructions, without adding or subtracting anything. Therefore when ’Aishah (may Allah be pleased with her) was asked about the menstruating woman making up the fasts, but not the prayers, she objected to the questioner asking such a question, because we are not meant to understand the reasons behind rituals and acts of worship.  Then she said: We were commanded to make up the fasts but we were not commanded to make up the prayers. And with regard to the issue of the Lawgiver making the diyah for injury to fingers equal, Ibn Al-Musayyib said: That is the Sunnah, O son of my brother. And there are many such cases.” (Al-Muwafaqat (2/526)

Because it is one of the rituals of Hajj, and Hajj is connected to Makkah, and most of its actions are done within the boundary of the Haram zone, therefore slaughtering the hadiy within the boundaries of the Haram zone is in harmony with the fact that the main location for the act of worship that is Hajj is Makkah.
Slaughtering the hadiy and distributing its meat within the Haram zone is for the purpose of relieving the poor people of the Haram of hardship and comes under the heading of the provision that Allah has guaranteed to the people of this House, in response to the supplication of Ibrahim (peace be upon him), as Allah, may He be exalted, tells us that he said (interpretation of the meaning):

“O our Lord! I have made some of my offspring to dwell in an uncultivable valley by Your Sacred House (the Ka`bah at Makkah); in order, O our Lord, that they may perform As-Salat (Iqamat-As-Salat), so fill some hearts among men with love towards them, and (O Allah) provide them with fruits so that they may give thanks.” [Ibraaheem 14:37] (See: Al-Mughni, by Ibn Qudamah, 5/451)
And Allah knows best.