A dog cannot grasp our nature or moral code by it's own means. However we manage to impart on dogs not to bark loud, to roll over, to pee outside, to be 'good' and not to be 'bad'. How is it that an entity to which we are ineffable has grasped a basic moral structure from us and is obeying them?
You
cannot train a dog not to bark; it is not possible. Dogs have a complex social structure of their own, all we do is replace the 'top dog' figure and use our influence to effect their behaviour. We do not, and can not, embue an unintelligable moral code on them. In other words you can only teach a dog to do things that are intelligable on their own terms. Dogs have a natural understanding of territory; pack, friend and not-shitting-where-you-sleep. They have a natural understanding of hierachical command (don't believe me? Do some research into how Arctic Wolves hunt), which in certain breeds (e.g. Border Collies) has been bred to an extrordinary degree.