It's safe, if unnerving. See this thread for some discussion on the subject. https://www.eevblog.com/forum/projects/strange-electrical-sensation-from-my-laptop/ … Basically, the power supply has to send electrical noise into the outlet, but that also causes a tiny current to flow back from the mains to the case.
On a grounded socket, the laptop can just be grounded and you get no current when you touch it. On an ungrounded socket, the best the PSU can do is couple the output to the average between line and neutral, so you get half of mains voltage on the case (but at a very low current).