Question: There are birds that harm agricultural crops such as fruit, grain, and the like. There are also dogs that harm crops. Is it permissible to kill the birds and dogs that harm the crops, or not?
The answer – and Allah is the One who grants success – is that it is obligatory to ward off the harm of birds, dogs, and similar creatures by whatever means possible, even by killing. It is already permitted to ward off the harm of a human being even by killing him if his harm cannot be repelled except thereby, and dogs, birds, and the like have less sanctity than human beings.
The evidence for the permissibility of warding off the harm of a human from one’s self or property – rationally – is that rational people of various religions and otherwise deem it good to ward off the harm of human beings from the self or from property, even by killing, if it cannot be averted except in that way.
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2