The billionaire tech mogul's comments came after the Taoiseach revealed new legislation to crack down on hate speech after violent anti-immigrant rioting Dublin.
Musk made the comments on his own social media platform X, formerly known as Twitter.
It came in response to a post where one user claimed the Irish government "want all of your freedoms," after Varadkar announced new legislation to combat hate speech.
Musk's comments on X were followed by dozens of anti-Varadkar posts, many of which were racist in tone.
On Thursday afternoon a stabbing incident in Dublin saw three children and an adult injured near a school, which some people blamed on the government's immigration policy.
Police say right-wing agitators were behind violent protests which followed the stabbing, bringing angry mobs onto the streets of the city centre, burning vehicles and smashing windows amid a wave of anti-immigrant sentiment.
Politicians on all sides have condemned Thursday night's rioting.