For installing a new exterior light on a brick wall, can I connect the wires in a junction box mounted on the opposite side of the wall?
So long as all the connections are inside the junction box you should be fine to do that.