Can the following sentences:
It’s the church where the painting burned./It’s the church in which the painting burned.
be transformed so that they do not contain the pronoun which/where in the following way:
It’s the church the painting burnt in.
Yes, the relative pronoun can be omitted.
In informal styles, we often leave out the relative pronoun. We only do this in defining relative clauses, and when the relative pronoun is the object of the verb. We don’t leave out the relative pronoun when it is the subject of the verb nor in non-defining relative clauses […]
In your example you have a defining relative clause.