Praise be to Allaah.
The scholars (may Allah have mercy on them) differed concerning the fasting person swallowing phlegm or mucus: does it invalidate the fast or not? The correct view is that it does not invalidate it, because it does not come under the same heading as food and drink.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: When the scholars differ, the reference point is the Qur’aan and Sunnah. If we are uncertain about a matter, as to whether it invalidates the act of worship or does not, the basic principle is that it does not invalidate it (unless there is evidence to the contrary). Based on that, swallowing phlegm does not break the fast.
What matters is that one should leave phlegm and avoid trying to bring it up to the mouth from the throat. But if it comes up to the mouth, he should expel it, whether he is fasting or not. With regard to putting drops in the ears and whether that breaks the fast, that requires evidence that will be proof for the individual before Allah, may He be glorified and exalted, concerning breaking the fast.
End quote from Majmoo‘ al-Fataawa, 19/356
He also said: The more correct view is that phlegm does not break the fast even if it reaches the mouth and one swallows it. It does not break the fast but one should not swallow it, because the scholars forbade that, because it is something off-putting and one should not swallow it.
End quote from Liqa’ al-Baab al-Maftooh, no. 152
As for putting one’s finger in one’s ear, that definitely does not break the fast. In fact, even if one puts drops or medicine in the ear and can taste it in the throat, that does not invalidate the fast because there is no evidence to suggest that the fast is invalidated by that.
For more information please see the answer to question no. 80208
And Allah knows best.