Short answer
Yes, Muslims must obey the law of the country they live in, in the West and everywhere else, and their religion is what binds them. A Muslim who lives under a country's protection has an agreement with it. The Qur'an commands Muslims to fulfil their agreements. The Prophet (ﷺ) said breaking promises is a mark of a hypocrite. So a Muslim who cheats on his taxes or lies to the benefits office is breaking the Sharia, not following it. The Sharia he keeps is mostly prayer, charity, honesty and family life. His one exception: he must not obey an order to sin. The law in Britain, America and most countries allows many things Islam forbids, but almost never commands them. No private Muslim, in the West or anywhere else, may enforce Islamic penalties. They belong only to a lawful court in a Muslim state. Nor may Muslims force the Sharia or Islam on others. That would break their agreement, and the Qur'an says there is no compulsion in religion.
Full explanation
Keeping agreements is a command of God (﷾)
A Muslim may be born in a country, settle there, or come on a visa. In each case he lives under its protection, and that is an agreement. The Qur'an tells believers to fulfil their obligations, not to break oaths once confirmed, and to keep every engagement. It says every engagement will be asked about on the Day of Judgement.
“O ye who believe! fulfil (all) obligations.”
“Fulfil the Covenant of Allah when ye have entered into it, and break not your oaths after ye have confirmed them; indeed ye have made Allah your surety; for Allah knoweth all that ye do.”
“Come not nigh to the orphan's property except to improve it, until he attains the age of full strength; and fulfil (every) engagement, for (every) engagement will be enquired into (on the Day of Reckoning).”
A treaty comes before helping fellow Muslims
The Qur'an holds a treaty so high that it limits even the duty to help other Muslims. When believers elsewhere ask for help, Muslims must give it, except against a people with whom they have a treaty.
“Those who believed, and adopted exile, and fought for the Faith, with their property and their persons, in the cause of Allah, as well as those who gave (them) asylum and aid,- these are (all) friends and protectors, one of another. As to those who believed but came not into exile, ye owe no duty of protection to them until they come into exile; but if they seek your aid in religion, it is your duty to help them, except against a people with whom ye have a treaty of mutual alliance. And (remember) Allah seeth all that ye do.”
What the classical jurists said
Muslim jurists (scholars of Islamic law) applied this to a Muslim who enters a non-Muslim land under a promise of safety. Ibn Qudamah, a scholar of the 12th and 13th centuries, ruled that he may not betray its people or take their property. The reason is that the safety was given on that understanding. The Prophet (ﷺ) also warned that whoever kills a person under treaty with the Muslims will not smell Paradise.
Ibn Qudamah, a Hanbali jurist, holds that the matter of jihad is entrusted to the ruler (imam) and his judgement, and that the people must obey him in it. He makes one exception: if an enemy attacks suddenly and there is no time to ask the ruler, the people may defend themselves without his permission. He also holds that a Muslim who enters a non-Muslim land under a promise of safety (aman) may not betray its people or take their property, because the safety was given on the understanding that he would not betray them, even if this was not said in words.
Abdullah ibn Amr reports that the Prophet (ﷺ) said that whoever kills a person who has a treaty with the Muslims will not smell the fragrance of Paradise, though its fragrance reaches a distance of forty years.
Breaking your word is hypocrisy
The Prophet (ﷺ) listed breaking a promise among the three signs of a hypocrite. So a Muslim who cheats on his taxes, lies to the benefits office or breaks the law of the land is not following the Sharia. He is breaking it. The Qur'an also allows Muslims to deal kindly and justly with those who do not fight them.
Abu Huraira reports that the Prophet (ﷺ) said the signs of a hypocrite are three: when he speaks he lies, when he makes a promise he breaks it, and when he is trusted he betrays the trust.
“Allah forbids you not, with regard to those who fight you not for (your) Faith nor drive you out of your homes, from dealing kindly and justly with them: for Allah loveth those who are just.”
The one exception
The Prophet (ﷺ) taught that a Muslim must obey those in authority except when ordered to sin. In Britain, America and many other countries this means very little in practice. Their law allows drink, gambling and sex outside marriage. But a law that allows a thing does not command it. A Muslim who refuses a drink breaks no law. The exception lets a Muslim refuse to commit a sin himself. It gives him no right to break any other law.
Abdullah ibn Umar reports that the Prophet (ﷺ) said a Muslim must listen and obey those in authority, whether he likes it or not, unless he is ordered to disobey God. If he is ordered to commit a sin, there is no listening and no obeying.
What the Sharia a Muslim keeps actually is
The word Sharia means a path. Most of it is worship, ethics and family life: prayer, charity, fasting, honest trade, marriage, and kindness to parents and neighbours. Most of it is kept at home and in the street, not in a court. The scholar al-Ghazali, who died in 1111, wrote that its aim is to protect five things: religion, life, mind, family line and property. The criminal penalties are a small part of it, and they belong only to a lawful court in a Muslim state.
In this work on the principles of Islamic law, al-Ghazali holds that the aim of the Sharia for mankind is to protect five things: their religion, their life, their mind, their offspring and their property. Whatever protects these five is a benefit (maslaha), and whatever destroys them is a harm to be prevented.
One of the standard reference works of Islamic law (Hanbali school). It opens with the Book of Purification and then Prayer, followed by funerals, charity, fasting and pilgrimage. Trade, inheritance, marriage and divorce follow. The books on injuries, blood-money and the fixed penalties (hudud) come in its later volumes.
No private enforcement, and no compulsion
No private Muslim, in any country, has any right to enforce Islam's criminal penalties on anyone. They belong only to a lawful authority in a Muslim state, with a qualified judge and the strict proof the law demands. A person, family or group that takes such a matter into its own hands is itself breaking the Sharia. Nor may a Muslim force the Sharia on the country that protects him. He has an agreement with it, and the Qur'an commands him to keep his agreements. And no law can make anyone believe: there is no compulsion in religion.
Ibn Qudamah, a Hanbali jurist, holds that, as a rule, no one may carry out a fixed penalty (hadd) except the ruler (imam) or the one he appoints to act for him. The only exception he allows is an old ruling on a master and his own slave, which has no application today.
“Come not nigh to the orphan's property except to improve it, until he attains the age of full strength; and fulfil (every) engagement, for (every) engagement will be enquired into (on the Day of Reckoning).”
“Let there be no compulsion in religion: Truth stands out clear from Error: whoever rejects evil and believes in Allah hath grasped the most trustworthy hand-hold, that never breaks. And Allah heareth and knoweth all things.”
Perspectives
The Islamic perspective
A Muslim who lives under a country's protection is bound to keep its laws, as he would keep any agreement. The Qur'an and the teaching of the Prophet (ﷺ) bind him. He may refuse only an order to sin, and he may never enforce Islamic penalties himself.
The Qur'an commands believers to fulfil their obligations and keep every engagement.
The Qur'an forbids helping fellow Muslims against a people with whom Muslims have a treaty.
Classical jurists spoke of a Muslim who enters a non-Muslim land under a promise of safety. They forbade him to betray its people or take their property.
The Prophet (ﷺ) named breaking promises as a sign of hypocrisy.
Obedience to authority has one limit: no obedience in sin. A law that permits a sin does not command it.
Islamic penalties belong only to a lawful authority, so no individual or group may enforce them.
The Qur'an forbids compulsion in religion.