Yes, but it must be with just cause. Here is what the Code of Canon Law says:
“The proper place to hear sacramental confessions is a church or oratory. The conference of bishops is to establish norms regarding the confessional; it is to take care, however, that there are always confessionals with a fixed grate between the penitent and the confessor in an open place so that the faithful who wish to can use them freely. Confessions are not to be heard outside a confessional without a just cause” (CIC 964).