We can train animals to love procedures and other things that they dislike or even hate by combining the process of counterconditioning with desensitization.
With classical counterconditioning we train the pet to associate the handling with things they like such as food, treats, petting, or play so that they are in a positive emotional state rather than feeling fearful or angry. We generally combine counterconditioning with desensitization, meaning that we start by introducing the handling or aversive stimulus at a level that the pet always acts as though they don't even notice the handling or stimulus that they previously disliked.
With operant counterconditioning, we train the pet to perform a behavior that's incompatible with the undesirable behavior. Ideally the pet earns a reward so that they are simultaneously learning a positive association with the situation. For instance, we may reward a pet to remain stationary and calm while you perform a given procedure.