Petting and scratching a horse are a good thing. Letting them use you as a scratching post is not. Know the difference, because this carries over to their relationship with you and how they see you in the herd pecking order. We start working with our horses when they are very young. Young horses don't have much of an attention span, 20-30 minutes of training is about all that they can handle at first.
Older horses can handle more time, but they sometimes take longer to teach.
It's not that they are set in their ways and can't be taught, they can learn new things. Depending on how the initial training was established, that's where your work comes in to play. If you know the history of the training on the horse, you can use this information to your advantage. Don't put a time limit on your training. This stuff takes as long as it takes, be prepared to commit three hours to work on a shoulder yield.