Yes if they repent and seek absolution from the appropriate priestly authority.
There are degrees of punishment as is evident by a full reading of the following
Catholic Encyclopedia, excommunication
Excerpt
newadvent.org/cathen/05678a.htm
Absolution from excommunication
Apart from the rare cases in which excommunication is imposed for a fixed period and then ceases of itself, it is always removed by absolution. It is to be noted at once that, though the same word is used to designate the sacramental sentence by which sins are remitted and that by which excommunication is removed, there is a vast difference between the two acts. The absolution which revokes excommunication is purely jurisdictional and has nothing sacramental about it. It reinstates the repentant sinner in the Church; restores the rights of which he had been deprived, beginning with participation in the sacraments; and for this very reason, it should precede sacramental absolution, which it thenceforth renders possible and efficacious. After absolution from excommunication has been given in foro externo, the judge sends the person absolved to a confessor, that his sin may be remitted; when absolution from censure is given in the confessional, it should always precede sacramental absolution, conformably to the instruction in the Ritual and the very tenor of the formula for sacramental absolution…"
The
Catechism of the Catholic Church states:
1463 Certain particularly grave sins incur excommunication, the most severe ecclesiastical penalty, which impedes the reception of the sacraments and the exercise of certain ecclesiastical acts, and for which absolution consequently cannot be granted, according to canon law, except by the Pope, the bishop of the place or priests authorized by them. In danger of death any priest, even if deprived of faculties for hearing confessions, can absolve from every sin and excommunication."
Code of Canon Law
Can. 1364 §1. Without prejudice to the prescript of ⇒ can. 194, §1, n. 2, an apostate from the faith, a heretic, or a schismatic incurs a latae sententiae excommunication; in addition, a cleric can be punished with the penalties mentioned in ⇒ can. 1336, §1, nn. 1, 2, and 3.
Canon. 1324: “Heresy consists in a pertinacious denial of truths which have been defined and proposed by the Church as divinely revealed doctrines.” c. 1325.2: "Any baptized person… who pertinaciously denies or doubts any of the truths proposed for belief by divine and Catholic faith, is a heretic. …if he rejects the authority of the Supreme Pontiff or refuses communion with the members of the Church who are subject to him, he is a schismatic."Can. 1364 §1. Without prejudice to the prescript of ⇒ can. 194, §1, n. 2, an apostate from the faith, a heretic, or a schismatic incurs a latae sententiae excommunication; in addition, a cleric can be punished with the penalties mentioned in ⇒ can. 1336, §1, nn. 1, 2, and 3.
Any priest, even one suspended or excommunicated, may validly absolve a person of all sins, including an excommunication, when such a person is in danger of death and no other priest can be obtained.
Book VI Sanctions in the Church Part I OFFENCES AND PUNISHMENTS
IN GENERAL
vatican.va/archive/ENG1104/__P4U.HTM