Yes, they are both ok.
"He will recognize me when he sees me." is telling us that the dog will know what you look like when he sees you.
"He will remember me when he sees me" is telling us that the dog will think of memories of you when he sees you.
They are very similar sentences.
I hope this helps.