Can I use ATmega328 TX/RX pins to drive an R2R network and still use the serial port to program the MCU?
I have answers for all your stated questions:


Your circuit will not provide a varying voltage on the output by itself, just a varying current source. The actual voltage generated will depend highly on the impedance of the device connected to the output. You may want to fix this with an additional resistor to ground, and/or an opamp.
Your circuit will likely allow serial communication, especially at slower rates like 19200 which I think are by default used by Arduino-style serial bootloaders. The 50 kOhm pull-up effect doesn't matter. The 1 kOhm resistance doesn't slow down too much.
Your circuit is unlikely to burn or stress the Atmega or the serially connected device.
I can think of three other ways, see below.


The first way would be to use a ICSP USB programmer to program the Atmega instead of serial programming, Arduino-style. This is more robust, faster, and avoids the problem entirely, and optimizes for BOM cost for the actual device (at the expense of requiring a few dollars of programmer hardware if you need to actually program it.) This can be implemented even on an Arduino board.

The second way is to run the Atmega328p on the internal RC oscillator, not using a crystal, and use port B instead of port D for the DDS output. This leaves the serial port entirely un-touched.

The third way is to write PORTB and PORTD one after the other, and use PORTB for the two bits that the serial port uses. This will generate a two-cycle glitch at about 4-8 Mhz. Given that you will need a low-pass filter anyway to generate any kind of smooth waveform, you simply need to lower the cut-off frequency of that filter to eliminate these glitches. To properly write the two ports in sequence, load the values into registers, disable interrupts, write the two ports, and re-enable interrupts.

Finally, you could use a small-signal diode (like 1N4148) instead of R17.