When you use the programming pins as ordinary GPIOs then you can do what you want with them. However, when you want to use them as programming pins then they should be unloaded.
You can achieve this by taking the components used for normal IO out of circuit when you are trying to program the MCU but this can be more trouble than it is work - except perhaps during the code development with a prototype board.
If you are *VERY CAREFUL* and stay within the published limits (as others have pointed out they are all in the documentation) the you can add pull-up and pull-down resistors etc. and still be able to program the MCU bu that is up to you.
Susan