Is it permissible to pray behind something impure?

For example an impure doorknob?

As long as the place of prostrating is tahir it is fine