With regard to the maks (duty, tax) that is taken from the Muslims, this is haraam, because Allaah says (interpretation of the meaning):
“O you who believe! Eat not up your property among yourselves unjustly” [al-Nisa’ 4:29]
And the Prophet (peace and blessings of Allaah be upon him) said: “It is not permissible to take the wealth of a Muslim except with his consent.” (Narrated by Ahmad and classed as saheeh by al-Albaani in al-Irwa’, 1459). Siddeeq Hasan al-Bukhaari said in al-Rawdah al-Nadiyyah, 2/215, concerning customs duty that is levied on the Muslims: “ If we think about it, this is undoubtedly nothing more than the maks.” Maks is a kind of tax and refers to money that was taken from vendors in the market-places during the Jaahiliyyah, or taken from merchants when they passed through. (See ‘Awn al-Ma’bood, hadeeth no. 2548). This tax is one of the major sins, because the Prophet (peace and blessings of Allaah be upon him) said, concerning the woman who had committed zina (adultery), then came to the Prophet (peace and blessings of Allaah be upon him) so that the hadd punishment might be carried out on her, “By the one in Whose hand is my soul, she has repented in such a way that if the one who wrongfully takes the maks from people had repented like this, he would have been forgiven.” (Narrated by Muslim, 3208). Al-Nawawi (may Allaah have mercy on him) said in Sharh Saheeh Muslim (11/203): “This shows that the maks is one of the most evil of sins and actions that condemn a man to Hell.”
If a Muslim cannot find any means of warding off this evil from himself other than paying a sum of money to the customs official, then it is permissible for the one who is paying to do that, but for the official who takes this money, it is haraam for him. See Majmoo’ al-Fataawa by Shaykh al-Islam Ibn Taymiyah (30/359, 358). This is so long as no greater evil will result from that unavoidable bribe. But if a greater evil will result from that, then it is not permissible to pay it in that case. Also, we must point out the importance of not telling lies. If a person is forced to pay then he should pay and seek the reward for his being wronged with Allaah. And Allaah knows best.