It could be due to an internal injury from trauma. Is it possible he/she has been hit by a car or that someone could have kicked him/her. Has the dog had a chance to roam where some kind of accident or attack could have happened? It is also possible he/she has a urinary tract infection or some other condition affecting her bladder or kidneys. Only a vet can tell for sure. This is a symptom of a potentially life threatening problem and the dog needs to be seen by a vet.