It is possible for dogs to get piles, also known as hemorrhoids, but because of a dogs' anatomy, it is rare. A more common and similar-appearing condition in dogs is having inflamed anal sacs.
Hemorrhoids are caused by excessive pressure being applied to the anus. This makes the blood vessels inside the anus swell and become painful. Hemorrhoids are very common in humans because humans sit and defecate in positions that place the body's weight directly upon the area surrounding the anus. Dogs sit and defecate with four paws on the ground, so that their body is supported in part by their legs instead of by their rear end. This is why piles are much less common in dogs. Veterinarians ascribe them to poor diet or muscle tone when they do occur. Inflamed anal sacs, on the other hand, are a common issue in dogs. Like hemorrhoids, they present anal pain and swelling.