"The dog goes over to the Hungarians, and not the Spanish man."
Translation:A magyarokhoz megy oda a kutya, nem pedig a spanyol emberhez.
I would not use "átmenni" and "odamenni" as synonyms, because "átmenni" has the additional meaning of crossing something while going over.
Using férfihez instead of emberhez is ok :-)
And now to the intension of the sentence, which is always a big problem in translating. The english sentence focusses on the fact, that the dog goes over to the Hungarians instead of someone else.
Thats why the Hungarians have to be put in the focus = in front of the verb, replacing the prefix behind the verb (odamegy => megy oda):
"A magyarokhoz megy oda a kutya, nem pedig a spanyol férfihez."
"A kutya a magyarokhoz megy oda, nem pedig a spanyol férfihez."
"A kutya átmegy a magyarokhoz, nem pedig a spanyol férfihez"
...has narrative character, which is not wrong at all. But it focusses on the prefix "át-", not on the Hungarians as it is meant in the english sentence.
I hope, it is a bit clearer for you now :-)