For ISP (In-System Programming) of ATMega8s through it's SPI like low voltage programming, you would use series resistors on the SPI lines, if you are using them at all for anything else. The series resistors will allow anything connected directly to the pins to overpower anything on the other side of the resistors. In this case, the ISP programmer will have priority to rewrite the AVR without being affected by any communications from the other side.
This is a common question: SPI device prevents ISP programming
As for the DS1307, it depends on if it is being used with a battery/power source on VBat. From the datasheet:
When VCC falls below 1.25 x VBAT, the device terminates an access in progress and resets the device address counter. Inputs to the device will not be recognized at this time to prevent erroneous data from being written to the device from an out-of-tolerance system. When VCC falls below VBAT, the device switches into a low- current battery-backup mode. Upon power-up, the device switches from battery to VCC when VCC is greater than VBAT +0.2V and recognizes inputs when VCC is greater than 1.25 x VBAT.
VBat must be between 2v and 3.5v, or tied to ground if not needed. If there is a battery, removing power from VCC but not the i2c lines should place the device in timekeeping mode only. i2c communication would be ignored. If there is no battery (and VBat tied to ground), it is unknown how the DS1307 will act. It could pull full power from the i2c lines, through clamp diodes, to power the DS1307 in full function mode. It might pull enough to place it into time keeping mode only. It might go into an undefined state. Or it might not pull power at all.
At best, the RTC will keep time without fail. Or you might have to reprogram it. At worst, you could cause damage to the device and have to replace it. Considering the cheapness of the DS1307, you could experiment to see.