That 'feeling' you got telling you not to may have been a warning. You and your dog are both safe, that's all that matters.
Wait, would it have been dangerous for you too? how big is that dog? If it was putting your own life in danger then no don't feel bad. I don't know what I would do if my son drowned saving his dog...
Then you made a perfectly reasonable decision.
... He got out. That is the important thing. You know you love him and he knows it too. It worked out so don't torture yourself with this question.