It is said that its origin is the changing of calendars that took place in 1582. Previously to that date, the New Year celebration took place from 25th March to 1st April. With the introduction of the Gregorian calendar in 1582, the celebration was moved to 1st January.
But as the media at that time were not what they are today, in many places people were not aware of the change until years later, so 1st April continued as a reference. This resulted in the habit of playing tricks on those people on that day, custom which eventually spread to England and Scotland in the eighteenth century and later to the American colonies and the rest of the world. You can read about that if youclick here.