Thanks. To give you a bit more detail, I'm a huggy person, and being affectionately touched by friends doesn't tend to bother me. Some years ago, after having felt the awkwardness of a male friend getting a hug from me I felt ashamed at having messed up and stopped.
The unsolicited therapist's touch didn't bother me in itself too much. It was more what it symbolized that bothered me. It was another piece of evidence that the well-meaning therapist's boundaries and own awareness needed more work, and I wasn't paying to be in the room to help her with herself. Clearly, the exact opposite - which is why I decided to end treatment.
Let's remember that for very many therapists, their preferred mode of self-development or personal growth has been to become a therapist., and this is very well documented inside the profession.
Even asking for consent to hug could be problematic. Request for consent can feel like pressure from the person with power - power which a therapist certainly has. About 20 years ago a dentist, mid appointment with my mouth open and his equipment in my mouth, asked for my consent to kill one of my teeth. Of course I said yes, because I thought he was the experienced professional and I was the ignorant patient. Today, dentists tell me that it shouldn't have happened.
When I was a younger man I interviewed people for a living in a non-therapeutic line of work, sometimes about the death of their next of kin. There was one occasion when a woman interviewee was crying as she recounted the death of her father. I held out my open hand, palm facing upwards. She took it, and we shook hands. I'm proud of that occasion and I hope in future to resort to that way forward.
So personally I'd be happier if your therapist had asked you what you feel you needed right then, rather than asking you the suggestive question about the hug. Still, I am very glad it was right for you and that she didn't mess up.