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?"