Native Russian speaker, but not a linguist
Yes, you can, but there is a slight difference. In Russian, the order of words in a sentence can be used to put a semantic emphasis. Usually, the last word carries the main burden, or, in other words, the last word is stressed out
So, when I read these sentences I read them this way (in parentheses - my understanding, the information I've got):
- Девочка ничего не понимает (something is happening around a girl, but the girl is a bit confused)
- Девочка не понимает ничего (probably, the girl is a bit stupid because she understands NOTHING. Or the really strange things have happened there)
In the first case we are talking about girl's reaction (не понимает), in the second - about the amount of information recognized by that girl (ничего).
I am not sure that I am explaining... But! The answer to the main question: yes, both Russian sentences are valid and correct, and they have almost the same meaning.
Probably Девочка меня не понимает unless you were really trying to emphasize ME. More like, if in conversation: "The girl doesn't understand who?" - "The girl doesn't understand me"
And I believe девочка не ничего понимает is something like "the girl understands not-nothing" but don't take my word for it