In Drupal, you can create a nested hierarchy with your taxonomy terms. For my case, I have the following vocabulary structure.
I want the URL to look like https://example.com/canada/quebec/montreal.
By default, the [node:field_ho_location:entity:parents] token does provide all the parent terms.
However, it will concatenate each parent term with an hyphen and will generate URL like https://example.com/canada-quebec/montreal.
Luckily, token module does provide function to manipulate the results. I used :join-path
function to replace the hyphen with a forward slash.
So, my final pathauto pattern looks like this.
[node:field_ho_location:entity:parents:join-path]/[node:field_ho_location:entity:name]
The URL generated is https://example.com/canada/quebec/montreal.