Yes, you should consider yourself very lucky. You were really stupid to walk into a house that you weren't 100% sure belonged to your brother.
You were also lucky the dog didn't tear you to shreds.
Entering in ANY house without express verbal permission, only after being met first at the door by the resident, isn't something I would even consider doing. Especially at night.
If someone trespassed in my house, they'd have found themselves lying spread eagle on the ground with a rifle aimed at them, waiting for the cops to arrive. *If* their story checked out, and *if* they seemed like a decent person, and *if* I wasn't in a bad mood, I'd consider not filing trespass charges.
And that's only because I don't have kids. Folks with children to protect would likely handle the situation more aggressively, as they should.