Praise be to Allah.
Firstly: inhaling incense (bakhoor) is prohibited when fasting
What is prohibited when fasting is inhaling incense, not merely smelling its fragrance, because incense has particles, so if it reaches the throat, it breaks the fast.
It says in Haashiyat al-Dasooqi (1/525): If the incense smoke or steam from the cooking pot reaches the throat, it becomes obligatory to make up the fast.
That applies if it reaches the throat through deliberately inhaling, whether the one who inhales it is the one who is burning it or someone else. But if one of them reaches the throat without any voluntary action on the person’s part, then no making up of the fast esist required, either from the one who was burning it or from anyone else, according to the correct view. End quote.
Shaykh ibn Baaz (may Allah have mercy on him) was asked: Is it permissible to use perfume such as ‘oud oil or cologne or incense during the day in Ramadan?
He replied: Yes, it is permissible to use it, on condition that you do not inhale the incense.
End quote from Fataawa Ibn Baaz (15/267).
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked: What is the ruling on a fasting person using perfumes during the day in Ramadan?
He replied: There is nothing wrong with using them during the day in Ramadan or inhaling them, except incense, which should not be inhaled, because it has particles that could reach the stomach, as it is smoke." (Fataawa Ramadan p. 499).
Secondly: it is permissible for one who is praying to smell incense and perfume
There is nothing wrong with one who is praying smelling perfume or incense, for the Muslims have always perfumed their mosques with incense.
It says in Kashshaaf al-Qinaa‘ (2/372): It is Sunnah to sweep the mosque on Thursday, and to take out the sweepings, and clean it and perfume it on Thursday, and to burn incense in it on Fridays, and to do likewise on the Eids. End quote.
It cannot be imagined that one who is praying would hold the incense burner and inhale incense from it, and we have not come across anyone who mentioned this issue or the ruling on it if it were to happen.
The scholars have pointed out that there is nothing wrong with putting the incense burner in front of the worshippers, and that it does not come under the ruling on it being disliked (makrooh) to face towards fire whilst praying.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked: What is the ruling on putting an incense burner in front of the worshippers in the mosque?
He replied: There is nothing wrong with that, and this does not come under what some of the fuqaha' said about it being disliked to face towards fire [whilst praying]. Those who said that it is disliked to face towards fire gave as the reason for that fact that this is resembling the Zoroastrians in their worship of fire, but the Zoroastrians do not worship fire in this manner. Based on that, there is nothing wrong with putting the incense burner in front of the worshippers, or putting electrical heaters in front of the worshippers too, especially if they are in front of the congregation only and not in front of the imam." )Majmoo‘ al-Fataawa 12/409).
Shaykh Ibn Jibreen (may Allah have mercy on him) said: There is nothing wrong with putting the incense burner in front of the worshippers, even if there is a live coal in it. That is because what is disliked is placing a fire with open flames in front of the worshippers and in front of the rows, because fire is the object of worship of the Zoroastrians, so facing towards it is resembling their fire worship. This is the reason for the prohibition.
It is well known that the incense burner only contains a coal or ember, which cannot be described as fire with flames, and it does not resemble the object of worship of the Zoroastrians.
This serves a purpose, which is perfuming the mosque with incense. It is proven that on one occasion the Prophet (blessings and peace of Allah be upon him) called for khalooq [a kind of perfume] and perfumed the mosque with it, and the early generations used to perfume the mosques with perfume and incense.
End quote from the shaykh’s website:
And Allah knows best.