This is oft repeated and accepted wisdom, but I don't entirely agree with it. From personal experience I would say that dogs do indeed understand, provided that they knew what they did transgressed established rules, and even in some cases learned what was unacceptable even when not "caught in the act". Two of my non-Basenjis were farm dogs that did not come in the house, but did reside in the barn at night when my horses were there due to cold or inclement weather. I explained in no uncertain terms that I was not amused to find dog poop in the aisle when I arrived in the morning. After a few profanity laced outbursts from me, both dogs figured out what I was upset about, and thereafter "held it" until let out in the morning. One of these dogs went on to become a house dog for my sister, and he arrived already house broken although he had never resided in a house up to that point.
As to whether dogs understand that they have done something wrong, once they know the rules they absolutely do. I have lots of evidence for this, but if you have ever arrived home and witnessed a "guilty dog" expression before you discover what has transpired (not after, because they could read your body language), you know that they know you will not be pleased. I hasten to add, this does not happen with many Basenjis. The little darlings are great at dissembling. At one visit to my breeder's house, one of five adult Basenjis had peed on the floor. All five surrounded the puddle, each with a look of total innocence, as if to say "Who did that?"
I am lucky with my guy. Although he has attempted digging a few times and been told "no", he doesn't take advantage of my absence to pursue the habit. One exception was when I assume he was cold, and he dug his way under the comforter on the bed, managing to do some damage to the foamy we have on the bed to make it softer. (never assume the bed that felt soft enough in the showroom will be so when you get it home! 🙂 ) He has free run of the house and seldom abuses the privilege.
Obviously if the damage occurs when you are gone the only solution is to restrict his access to the things he is likely to harm. Or suffer the consequences. 😉
One of my girls has also trained me to lift the covers so she can burrow down and sleep under them. The other sleeps quite happily in her own bed, but has a habit of jumping on my husband when she wakes up, so he will give her a belly rub. Let's face it - they all train us - we have only what input they allow.