Praise be to Allah
The basic principle is that it is prohibited to impose taxes, because they come under the heading of makoos (levies) that are haraam.
This has been explained in the answer to question no. 42563.
However there is a concession allowing the imposition of taxes in exceptional circumstances, when the state needs that, on condition that it should be just and equitable, and that the taxes should be spent on valid purposes.
In al-Mawsoo‘ah al-Fiqhiyyah (8/247) it says that one of the sources of income for the bayt al-maal (treasury) is:
Taxes that are taken from the people to be spent on their interests, whether that is for jihad or other purposes. They are not to be imposed on the people except in the case that there are not sufficient funds in the treasury to cover that, and that it is only done in the case of necessity. Otherwise it is an illegitimate source of income. End quote.
If the taxes are of the prohibited type, it is prescribed to avoid them, so long as that will not result in greater harm, whether this is in a Muslim country or otherwise.
Shaykh Ibn Jibreen (may Allah have mercy on him) was asked: Is it Islamically permissible not to pay all taxes prescribed by man-made laws that are imposed by governments, and instead of paying all taxes that are imposed on me, I pay part of them only, and do not show my real accounts, such as the sum of all sales and the sum of year-end profits?
Examples of taxes include sales tax, tax on net profit, and so on. And this is regardless of whether I am living in a Muslim or non-Muslim country.
The ruling on working in tax collection is based on the details mentioned above. If the taxes are permissible, it is permissible to work in the collection thereof, but if the taxes are prohibited, it is not permissible to work in that field unless it is for the purpose of reducing them for people as much as possible.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) was asked about someone who is appointed to a position of authority and is obliged to take haraam taxes or levies from the people, but he strives hard to be fair and to eliminate injustice as much as he can, and to reduce the levies in his territory, waiving half of the levy. If he were to leave that position of authority, his place would be taken by someone who would increase the injustice. He replied as follows:
Yes, if he is striving to be fair and just and to eliminate injustice as much as he can, and if his being in a position of authority is better for the Muslims and serves their interests more than anyone else being in that position of authority, and his being in charge of a territory is better than anyone else being in charge, as mentioned, then it is permissible for him to remain in that position of authority and in charge of that territory, and there is no sin on him for that; rather his remaining in that position is better than him leaving it, unless he could have a better position (in which he could serve the Muslims better) elsewhere.
That may be obligatory in his case, if no one else who is able to do that can take up that position.
Spreading justice as much as one is able and eliminating injustice as much as one is able is a collective obligation, which each person is expected to undertake as much as he can, if no one else could achieve that. In this case he is not expected to do what he is unable to do of eliminating injustice…
The one who is in charge of a territory and is trying to achieve good should try to relieve the Muslims of injustice as much as he is able to, and he should ward off the evil of evildoers by collecting some of that which is imposed on them, whatever he is not able to waive. In that case he will be doing good to the Muslims and not wronging them, and there will be no sin on him for what he takes of what is mentioned, and he will not be liable for what he takes. There is no sin on him in this world or the hereafter if he strives to be just and do good to the best of his ability.
End quote from Majmoo‘ al-Fataawa (30/356-360).
Working as a tax adviser is less serious than working to collect taxes, because the adviser is simply advising those who pay taxes, and he is not working for those who collect them and take them from the people.
There is no reason why you should not work in this field, so long as you will strive hard to be just and reduce injustice for people to the best of your ability.
Based on that, if your work as a tax adviser will lead to reducing prohibited kinds of taxes, then it is permissible.
And Allah knows best.