There is a Torah prohibition that forbids Kohanim from coming in contact with a human corpse. The Torah writes explicitly in the Book of Vayikra (21:1), “Speak to the Kohanim, the sons of Aharon, and tell them that they shall not defile themselves to a deceased human being.” This prohibition is codified in the Shulhan Aruch (Yoreh De’a 369). The prohibition of “Tum’at Kohanim” applies even nowadays, when we are all presumed to be Tameh (ritually impure) and we do not have access to the ashes of Para Aduma with which to become Tahor (ritually pure). This point is mentioned explicitly by the Shulhan Aruch (373:2).
A Kohen is, however, allowed to become “Tameh” in the case of the death of an immediate family member, Heaven forbid. He is allowed to attend the funeral, be under the same rood as the coffin, and also to go to the cemetery for the burial. Regarding such a case, the Ben Ish Hai (Rav Yosef Haim of Baghdad, 1833-1909) writes in his work Torah Lishmah that a Kohen should immerse in a Mikveh after the conclusion of the Shiba mourning period. Even though he was allowed to become Tameh, it is nevertheless proper for him to immerse in a Mikveh after the Shiba period. This applies also to a Kohen who became Tameh accidentally, such as if he walked into a home without realizing that there was a human corpse. Even though he became Tameh accidentally, it is proper for him to immerse in a Mikveh.
In the case of a Kohen who intentionally disregarded this prohibition, and knowingly went to a cemetery or came in contact with a corpse, the community should not call him for the first Aliya to the Torah, or to recite Birkat Kohanim, until he repents. This is the ruling of the Sefer Misvot Gedolot, in Siman 371.
It should be noted that a Kohen is forbidden from coming in contact with a human corpse, but not with other forms of Tum’a. Thus, for example, it is entirely permissible for a Kohen to come in contact with a Sheretz (carcass of a rodent) or a Nebela (carcass of a kosher animal). The only form of Tum’a which he must avoid is Tum’at Met – the impurity that results from contact with a human corpse. This point is made explicitly by Rashi, in his commentary to Masechet Bechorot.
Summary: A Kohen – even nowadays – may not come in contact with a human corpse, and may not visit a cemetery or be under the same roof as a corpse, except in the case of an immediate family member’s death, Heaven forbid. In the case of a family member’s death, it is proper for the Kohen to immerse in a Mikveh after the Shiba mourning period. This applies as well to a Kohen if came in contact with a corpse accidentally. A Kohen who intentionally violated this prohibition should be denied the privileges due to a Kohen until he repents.