Why were the Magyar Hungarians accepted into Europe and not seen as invaders? Why aren't the Turks treated the same? Does it have something to do with culture, religion, history, etc or just how long each group has been in Europe?
By the Turks if you mean Ottoman Turks and other Muslim Turkic groups, then the problem lies in their professed Islamic faith. Remember that once 'Turk' was used to refer to a Muslim similar to how the term 'Frank' was used to refer to Christian Europeans.
You can see this in how non-Muslim Turkic groups got assimlated rather easily and ended up fitting in somewhat like the Magyar. The Bulgars were a non-Muslim Turkic people, and no one really has much of a problem with their Slavic-speaking Bulgarian descendants.
This was because Islam was considered to be so at odds with European self-perception and identity being the obvious arch-nemesis of Christiandom which it was, which meant that even Europeans that became Muslim also ended being made into an 'other' and sort of occupying an ambigous position or being simply aggregated into whatever non-European Muslim population happened to be in ths area at the time, as happened in the Balkans and Spain and the like.