The legal marriage which is done in European countries is regarded as a valid marriage in shariah as long as there is no legal reason in shariah against the marriage. This is because the basic condition in a valid marriage is the agreement of the couple, which is present in case of the civil marriage or court marriage. Also, announcement is usually implied. As for the condition of two witnesses it is, according to some schools, required to guarantee that the marriage is announced, and this is achieved in a legal marriage. As for the agreement of the guardian, it is an issue of disagreement among schools of fiqh.
Therefore, the only condition which invalidates a court or legal marriage in the West is if there exists any reason which prevents marriage in shariah. For instance, a Muslim is not allowed to marry his foster-sister, though this is permissible in European laws. (Likewise, a Muslim woman is not allowed to marry a non-Muslim and a Muslim man is not allowed to marry any non-Muslim other than a Christian or Jewish woman, though all types of inter-faith marriage are permitted in Western laws.) Therefore, if a marriage is contracted between a Muslim and his foster-sister in a Western country, this marriage is not valid in shariah as there is a reason which prevents marriage and it is haram for the concerned partners to engage in sexual intercourse.
If there is no shariah reason to prevent the marriage, then the marriage done in a Western country can be regarded as a valid marriage in the eyes of shariah and can be accepted by shariah courts in Muslim countries. This is the rule, particularly if the Muslim couples are of a European nationality or origin. However, if one or both of them hold nationality of a Muslim country, then they must make the marriage contract in a Muslim country [or register it with the appropriate consulate(s) so that the marriage is recognized abroad]. If, however, they make the contract in a non-Muslim country, then the marriage is still valid as long as there is no shariah reason to prevent the marriage, yet they are sinful for not resorting to a Muslim court and accepting to apply non-Muslim laws instead.