Animals can not feel guilt. This is a human emotion.
Instead, what you are seeing is your animals reaction to you and your emotion. They don’t feel remorse after going through the trash, scratching something up, or breaking something when you weren’t around. However, when you show up and you are frustrated, they react to YOU. But they do not know why you are frustrated.
So what you see if their attempt at avoiding conflict and avoiding trouble. It is their attempt at showing you they see you are upset and showing you they don’t want to add to your emotion. So they show what we label as signs of guilt. However in an animal’s perspective they are trying to assume a submissive position to avoid conflict, to stay out of trouble, and to show you, they just want to keep the peace.
Animals are experts at reading human emotions. If you look upset, they want to avoid making you more upset. So they try to deescalate the situation by making themselves small, avoiding eye contact, trying to hide, etc. The last thing they want to do is make you more upset than you already are. So they assume their most non threatening positions and actions.
Because of this scolding them or continuing to be frustrated and upset only damages the relationship you have with your animal. When they are doing everything they can to maintain the peace, to avoid trouble/conflict, you scolding them only makes you unjust and unsafe in their eyes.

Unless you caught them in the act, they have no idea why you are upset. Animals are highly communicative beings. When you ignore their communication (them assuming submissive behaviors and actions) in these moments, you will cause them to live in confusion and fear.
Instead, stop and take a breath. Change your energy. Encourage your animal to approach you. They want to help us. They want to be your happy place! If you are upset, they want to comfort you. Let them know it is ok for them to comfort you. Be happy to see them despite the mess you walked into. Because I can promise you they are SO happy to see you every day, in all situations and under all occasions.
The mess is separate from your pet at that moment. If you didn’t catch them in the act there is zero connection in their mind. This is why they are such great teachers for us! You have to let it go. And allow your pet to make you smile. Doing this will create the deepest, truest bond. Your pet will feel SAFE with you. Your pet will continue to communicate with you instead of shutting down.