A couple was married in a civil ceremony. They attend Catholic church and are Catholic. Can they receive communion at mass?
A Catholic "married" in a civil ceremony is not in a valid marriage—unless they have regularized their marriage, thereby respecting the 6th precept of the Church on obeying the Church's marriage laws. If that Catholic is cohabitating and having sexual relations, he or she is committing fornication, which is a mortal sin. Receiving Communion outside of the state of grace (i.e., with a mortal sin on one's soul) is very dangerous:
1 Cor. 11:27:
Therefore whosoever shall eat this bread, or drink the chalice of our Lord unworthily, he shall be guilty of the body and of the blood of our Lord.
Catholicism views marriage as an important part of a Catholic's life, and something which (like so many important events) exists and should be celebrated in the context of the Church; that is, in the context of the community. Marriage between two Catholics is particularly significant in that it is sacramental; that is, it is a sign of God's grace by which divine life is dispensed to us (cf. Catechism of the Catholic Church paragraph 1131).
Because marriage between two Catholics is celebrated as part of their life in the Church, and draws its strength (as all events in Church life do) from the Eucharist, it is typically celebrated as part of a Mass (Catechism paragraph 1621, citing Vatican II's apostolic constitution Sacrosanctum Concilium, section 61). It is certainly to be celebrated in the Church if at all possible:
Sacramental marriage is a liturgical act. It is therefore appropriate that it should be celebrated in the public liturgy of the Church;
Marriage introduces one into an ecclesial order, and creates rights and duties in the Church between the spouses and towards their children;
Since marriage is a state of life in the Church, certainty about it is necessary (hence the obligation to have witnesses);
The public character of the consent protects the “I do” once given and helps the spouses remain faithful to it.
(Catechism paragraph 1631)
That is, since marriage is a state of life in the Church, and a sacrament, it is appropriate that it be celebrated by a liturgy, in public, and particularly in a church.
The Church does have laws (canon laws) protecting this important celebration; and Catholics are obliged to follow these:
Even if only one party is Catholic, the marriage of Catholics is governed not only by divine law but also by canon law, without prejudice to the competence of civil authority concerning the merely civil effects of the same marriage.
(Code of Canon Law, Canon 1059)
One of these laws is that it is to be customary to wed in one's own parish:
Marriages are to be celebrated in a parish where either of the contracting parties has a domicile, quasidomicile, or month long residence or, if it concerns transients, in the parish where they actually reside. With the permission of the proper ordinary [usually the bishop] or proper pastor, marriages can be celebrated elsewhere.
(Canon 1115, emphasis added)
Note that this does allow the wedding to be celebrated elsewhere; but permission is needed, and the ordinary or pastor may or may not grant it. The reasons listed above from the Catechism are intended to be pretty strong.
If permission was requested and granted, then the relationship is presumed to be a valid marriage, since marriage has the favor of the law, that is, it is presumed present until proved otherwise. If permission was not requested, however, or if it was requested and refused, then the marriage may be invalid due to a lack of canonical form. If this is the case (and only a diocesan marriage tribunal is competent to make a final judgment in the matter), then the relationship is not a valid marriage, and unfortunately the couple has been sinning in living together.
Such a sin would indeed make it a further sin to receive the Eucharist, until the couple go to Confession with the intent of reforming their lives from the sin. In this case, the typically expected "intent to reform" might reasonably take the form of physical separation, or at the very least continence, until the couple can speak with a priest and have their marriage convalidated.
No Catholics as a rule must be married in accord with what’s called canonical form. This still applies even when one of the parties to the marriage is not Catholic. The canonical form of marriage requires that the marriage be contracted in the presence of either one’s pastor, or another priest or deacon deputed by him, like the associate pastor or a priest-friend of the family (canon 1108).