You can if you are a baptized Christian and meet certain conditions, the most usual being immediate danger of death or impending reception into the Church. Unbaptized people, whether or not they self-identify as a Christian, may not receive confession. Baptism is the gateway to the other sacraments, and so an unbaptized person would first have to be baptized.