"Shit", like "fuck", is a very versatile word in the English language. Even dictionaries that do have multiple correct definitions for "shit" often aren't always fully comprehensive, and probably won't cover the nuance. There's comedy sketch by comedian Ismo that covers the various varieties of usage for "shit" that I would recommend you watch, because although he does assume his audience is aware of all the meanings already, it will demonstrate the breadth of uses you will find.
So, that out of the way, what does it mean?
Firstly, you must understand that the word "shit" is very vulgar, and almost always offensive in public situations. It is not a word you should say at work, within earshot of your mother, or around children. The vulgarity of the word colors most meanings of the word to be somewhat negative in some manner. Most, but not all.
Secondly, it's best to understand most meanings of the word "shit" to be a universal placeholder for... anything. It can be used as a noun, an adjective, a verb, an interjection, an adverb... as I already said, it's very versatile.
So, what does it mean in your specific example?
You can't do shit like that!
Or, remembering that "shit" usually is a placeholder word for anything relevant....
You can't do {placeholder word for anything} like that!
You can't do that like that!
In context, it means "You can't do what you just did, in the manner that you just did it." More specifically, it means "You can't sneak into the house without warning, even if you intended it to be a nice thing by bringing donuts."
Now, he fact that she is using a vulgar word to say this instead of simply "you can't do that" indicates that she is upset. That's the negative aspect of "shit" coming into play. She might be upset at him, or at herself, or at the situation in general... or any combination of the above... but she is definitely upset.