He would probably understand that you are talking about 'dog' if you use him (male dog); her (female dog); or it (dog of unspecified sex).
Did you walk him?
Did you walk her?
Did you walk it?
All are grammatically correct.
:up: ...but there are some people who would regard it as strange/unfriendly/cold/distant/unsympathetic to refer to a dog as 'it'. A flat-mate who hated dogs, who was expected to care for a dog while the owner was on a holiday, might refer to the dog as 'it'.