Yes, but it must be with just cause. Here is what the Code of Canon Law says:
Can. 964 §1. The proper place to hear sacramental confessions is a church or oratory.
§2. 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.
§3. Confessions are not to be heard outside a confessional without a just cause.