Thanks Juan and Claire, but something is still not clear..
"Consider a mutation by complete or partial deletion of an avr allele that then becomes virulent. Will the mutation happen in planta as the pathogen tries to evade recognition by R genes? Or does it happen before the pathogen lands on the plant? Or simply put, will pathogens mutate their genes before or after an attack?"
Mutations are random and independent of selection pressure. Having said that, active reproduction and thus DNA copying increases the risk of copying errors and thus mutations.
Most mutations are deadly and go unnoticed by scientists. Selection pressure plays a role in favouring one or the other non-deadly mutation after it occurred randomly.
So the pathogenicity mutation can occur before or after colonization, but if it is selected for, the selection would occur only after.