Programming ATMega328 from arduino with separated power supply
As long as both the device and the programmer share grounds and use the same signaling levels, the device can be programmed directly.

If they share grounds but do not use the same signaling levels then you will need to use a level converter.

If they do not share grounds then you will need to use optocouplers.