Well, a hemorrhoid is nothing more than a hemorrhoid. Regardless that's human nature, animal nature or whatever, your dog should be easily treated with same treatment as for humans.
But what is a hemorrhoid? Enlarged and uncomfortable blood vessels surrounding and in the anus also known as piles. So we are not talking about any kind of glands here. They are irritated blood veins.
Constipation and diarrhea are not helping at all in curing hemorrhoids. So you should feed your dog with high fiber foods.
If you can afford, you can even try H Miracle Cure:
http://natural-hemorrhoids-cure.blogspot.com/2009/06/h-miracle-cure.html
and I can guarantee you will work for your dog too.
For more information about hemorrhoids in general head on to:
http://natural-hemorrhoids-cure.blogspot.com main page.