Sri Lankan spin bowler Wanidu Hasaranga created history as he became the third bowler to scalp a hat-trick in his debut One Day International.