Young or trained fruit trees can be pruned in summer, as there are fewer spores around and less likelihood of fungal and “silver leaf” problems.
Pear trees can be pruned in mid July, or around ten days later if you are more northerly.
I tend to prune most established deciduous trees when dormant. You can often break this rule with saplings and prune back in summer; though heavy pruning will often encourage new growth.
Avoid cutting trees in the spring as you may get shedding of sap and do harm to nesting birds.