The reason dogs can hold back their urine is because they have their own physiological mechanism that allows them to control the excretion of urine. Dogs' bladders are elastic, which allows them to store urine in their bladders for a period of time. At the same time, dogs also have a muscle called the "urethral sphincter", which can help control the excretion of urine. When dogs want to pee, they relax these muscles and the urine is expelled from the bladder.
Sometimes dogs may be trained to control the excretion of urine, such as not peeing in public places. This requires owners to train their dogs and help them establish correct urinary habits. If your dog keeps tasting his pee or can't control his pee, it could be due to a medical problem. In this case, it is recommended that you take your dog to the veterinarian to ensure his health.