Treating constipation in dogs is no different to us humans really. High fibre diet and laxatives. Best consult a vet because if the object is abnormally large or could injure the dog while trying to pass it, it may require surgery to remove it. The vet can also advise on laxatives.