All perfect praise be to Allah, The Lord of The Worlds, and may His peace and blessings be upon our Prophet Muhammad and upon all of his family and companions.
The majority of Muslim jurists are of the view that female donkey's milk is impure and using it is impermissible based on the prohibition of eating its meat, since Ibn Omar (May Allah be pleased with them) narrated: "On the day of Khaiber, Allah's Messenger (PBUH) forbade the eating of garlic and the meat of donkeys." [Related by Al-Bukhary].
In this regard, Al-Imam An-Nawawi (May Allah have mercy on his soul) said (What means):" The meat of donkeys is impermissible for eating according to our doctrine and this opinion is adopted as well by the majority of Muslim scholars as Al-Khatabi who stated:" This opinion is adopted by all jurists." [Al-Majmooa' Sharih Al-Mohadab] 9/16].
Further, the yoghurt of a female donkey is impermissible for drinking based on the impermissibility of eating its meat, since Al-Imam An-Nawawi (May Allah have mercy on his soul) said (What means):" Al-Darami stated in the last chapter of his book "Al-Silm" regarding female donkeys yoghurt and the like mentioning three opinions in this regard and the most correct one is the one adopting impure; thusly, selling it is impermissible." [Al-Majmooa' Sharih Al-Mohadab 2/569].
As for medication, scholars are of the view that using impure substances for medication is permissible save wine and so long as no substitute is available, since it is stated:" The disagreement among scholars is in using impure raw substances, but using them as a substance among many other pure substances used in manufacturing of a product such as cream and the like is permissible so long as no impure substitute for medication is available. i.e. using snake meat or urine for treatment in general if this was for the purpose of hastening the cure and so long as a trusted Muslim doctor was consulted and confirmed so." [Mughni Al-Muhtaj 5/518]. Further, for a dire need, the treatment with impure raw substances is permissible and it is more prudent to use them as a single substance among many other pure substances within a medicine or a product as mentioned above.
Furthermore, the permissibility of using such a product is confirmed by Hanafi's jurists whereas they stated that if the impure substances changed to new pure substances by which their properties were lost then they are considered pure, and this process is called according to the Islamic jurisprudence by Istihalah (The change of properties of impure substances to new pure substances).
Ibn Humam, a Hanfie jurist, stated: "An example on this is the a sperm-drop is impure, then transforms into leech, which is also impure, then transforms into a clot, which is pure. Another example is that juice is pure, but it can be transformed into wine, which is impure, or vinegar, which is pure." {Fateh Al-Qhadeer, PP.1Vol.200}.
Therefore, there is no harm on using female donkey's milk in treatment if it was changed to a new impure substance throughout the process of adding Sodium Hydroxide material to milk by which its chemical properties were changed as a result and so long as no damage is inflicted while using it based on the report of specialized formal parties in charge of medicine manufacture. And Allah knows best.