The inflammation caused by a condition such as a urinary tract infection can cause your dog to not realize that he is peeing while asleep.
A dog with an infection of the urinary tract may have excessive thirst and therefore, pee more often - sometimes not waking when his bladder is full.