Your question has basically two parts: What does Viktor Navorski say to Milodragovich and Is the medicine really for goat or Viktor knew the rule and is trying to help the person?
I would try to answer them in that order
From this clip you can find the scene: Source at around 3:44sec what Viktor says in English, roughly translates to "izgo dasnaya zakogo ele karsvoto" with his pauses but in reality that would be more like
"izgo dasnaya lekarstvo za koza"
This is from a Bulgarian website and its comments. I took the Bulgarian comments and used Google Translate to understand the first part of the sentence.
[I admit Google Translate is not always the most accurate one, but for your first question I needed a somewhat rough idea of what Viktor said, so that Mr. Milodragovich could reply the actual word]
I had to use this crude approach as I could not find any authentic mention of this translation on the internet.Even in the script it was written "Hanks speaks in Bulgarian" Source
So, my answer to your first question would be: Mr Milodragovich possibly knew at least the meaning of "Koza" in English is "Goat" and rest of the information was supplied by Viktor in this Bulgarian dialogue.
As for your second ques: The medicine was actually for the father or else if it had been for the goat, Viktor would have easily interpreted it and all these scenes wouldn't have followed. Moreover the helpless expression of Mr Milodragovich and falling on his knees do suggest the same.
In this link Frank Dixon mentions:
Dixon: You'av been reading the immigration forms, the blue one.
Dixon: Yes.The blue form, the one that says if its an
animal he doesn't need the Medicinal Purchase License
At the end of the scene the expression on Viktor's face(the way he smiles) confirms the sense of happiness and satisfaction of being able to help a person (supposedly from close to his native) in spite of the fact that he didn't know him.