It was narrated from Umm Salamah (may Allah be pleased with her) that Prophet Muhammad (peace and blessings of Allah be upon him) said, “When you see the new moon of Dhul-Hijjah and one of you wants to offer a sacrifice, let him refrain from (removing anything) from his hair or nails” (Muslim). The majority of scholars, with the exception of Hanbalis and IbnHazm, agree on that it is only recommended for the one who wants to offer a sacrifice to refrain from removing anything (hair or nails) when he or she sees the new moon of Dhul-Hijjah.
Additionally, even the Hanbalis who say that it is obligatory, do not invalidate one’s sacrifice if he or she cuts his or her hair or nails. Thus, the sacrifice of those who cut their hair and/or trimmed their nails while not knowing that the moon of Dhul-Hijjah was seen is valid in sha‘ Allah.
In his response to this topic, Sheikh `Abdul-MajeedSubh, a prominent Azharite scholar, stated,
Refraining from cutting the hair and trimming the nails is a sunnah, thus it does not invalidate that sacrifice in anyway, even if the person knew that he was doing this after the beginning of Dhul-Hijjah.
Once the person learns about the beginning of Dhul-Hijjah, he or she is advised to refrain from cutting hair and trimming nails, and there is neither fear nor doubt for the validity of the sacrifice and he or she will get the reward of following the s unnah, in sha‘ Allah.
Moreover, Sheikh `AbdelKhaliqHassan Ash-Shareef, an Egypt-based renowned scholar and da`iyah, added,
There is no impact of what they did on the validity of their sacrifice. It is only recommended not to cut the hair or trim the nails in the first 10 days of Dhul-Hijjah for one who intends to sacrifice. However, if the person cut his or her hair or trimmed his or her nails, it is not considered to be a sin and there is nothing wrong with his or her sacrifice.
Elaborating on this issue, Dr. Muhammad`Abd Al-Latif Al-Banna, said,
First of all, the whole issue is sunnah, and refraining from cutting the hair or trimming the nails is not obligatory.
Second, there are opinions that say there is no problem in cutting the hair or trimming nails, which is the opinion of Ash-Shafi`i. He evidenced his opinion by the hadith narrated by `A’ishah (may Allah be pleased with her) that the Prophet (peace and blessings be upon him) used to send the animals for immolation from Madinah and he was not forbidden from anything that Allah made it permissible for him until he made the sacrifice. (Agreed-upon)
Additionally, it is mentioned in Hashiyatas-Sindi ` ala an-Nasa’i that the majority of scholars say that it is reprehensible [to cut the hair or trim the nails]. Some said the wisdom behind this is to be complete for emancipation from the Hellfire. Others said that the wisdom is to imitate the muhrim (pilgrims).
All in all, there is no harm in removing anything from the hair or nails in these days, and it is better to refrain from doing so.