Gyorgy Schopflin, a member of Hungary's ruling Fidesz party, made the remark after images emerged of vegetables carved into heads and placed along the country's southern frontier.
"Human images are haram... Pig's head would deter more effectively," he said.
Hungary has taken a hard-line stance on migration into the country.
Mr Schopflin made the comments responding to criticism from Andrew Stroehlein, European Media Director for the charity Human Rights Watch.
Mr Stroehlein hit back at Mr Schopflin, accusing him of "xenophobic filth" and calling him an "embarrassment to Hungary, to Europe and to humanity".
Other Twitter users called the MEP's comments "nasty" and accused him of racism.
He has refused to apologise, saying the remark was "hypothetical" and "a thought experiment".
Pork is considered impure by Muslims and its consumption forbidden.
Under conservative Prime Minister Viktor Orban, Hungary has taken a tough approach to migrants and refugees entering the country.
A razor wire-topped fence now separates stretches of the country's southern border from is neighbours and is patrolled by troops.
In October the country will hold a referendum on whether it agrees on the EU's mandatory refugee resettlement policy.
A Hungarian member of the European Parliament has been criticised for suggesting pigs' heads could be put on border fences to deter refugees.