Most of the dog's brain is used for the senses, and just a small region is reserved for the association of ideas. If the dog associates a determined object (aor a ball) or person to experiences he has lived with a high enough intensity, a series of answers will be originated conditioned reflexes that will be related directly with the nearness in time to the origin of the stimulus and its grade of positiveness or negativeness.
As of the kind of conditioning, we would have to distinguish between two models: the classic and the operative.
The classic model is the one obtained through the association by repetition. It deals with the viewing of the situations that cause the exemplar to externalize the conduct that you wish to encourage or hold back. By means of rewards or reprimands, and repetition, this conduct will finally be associated by the dog as something positive or negative.
For example, imagine the dog is walking by our side when we suddenly stop. The dog also stops, but doesn't sit. If we press adequately its hinds with our hands we will get the desired posture. After this, we should reward the dog with a cookie or something he likes. By repeating this same activity as many times as possible the dog will associate sitting down with a double reward. On one hand, he will associate this action to a pet on its back or to a delicious cookie; and on the other hand the satisfaction of having learned something that really pleases his master. After this, we can state that the classic conditioning program is the basis of every lesson you wish to teach your dog.
The operative conditioning technique, or casual reinforcement, is that that you can apply counting with some luck, meaning that this can be done only when the dog spontaneously externalizes a determined behavior. Whenever the dog acts in this spontaneous way you might want to reinforce it positively or negatively.