Yes, dogs can potentially harm themselves if they hold their urine and feces for extended periods. Typically, dogs need to defecate 1-2 times daily. If they are unable to relieve themselves, it can have serious consequences for their health.

Many dogs prefer to eliminate outside of their home, as they are naturally clean and don't want to soil their living space. If an owner is busy and cannot take their dog out frequently enough, the dog may hold it until the owner returns. However, it's crucial to remember that dogs need to defecate 1-2 times each day. If your dog hasn't pooped for over 24 hours, it's likely constipation, which requires immediate attention from the owner to prevent serious complications such as colon problems or even sudden death.
If your dog hasn't had a bowel movement for a day, it might be due to a lack of water, vitamins, or fiber, which can lead to dry, hard stools that are difficult to pass. It's essential for owners to assess their dog's diet. Are you feeding a diet high in meat and neglecting to provide sufficient water, vegetables, and fruits? If so, you need to make immediate changes. Reduce meat consumption and include more water-rich fruits and vegetables. Encourage your dog to drink water after meals to improve hydration and boost fiber and vitamin intake, which will help to prevent constipation.
Sometimes, the reason a dog can't poop isn't dietary, but rather due to impacted anal glands. If the anal glands are blocked, the dog will struggle to defecate. Owners need to lift the dog's tail and check the anus for blockages. If blocked, use a wet wipe to cover the anal area and gently squeeze the glands to express the fluid. Then, thoroughly clean the area. This will help your dog have regular bowel movements.