Hello,
Welcome to Microsoft Q&A!
Not all win32 functions are available in UWP apps. See Win32 and COM APIs for an overview of Win32 API available to UWP apps. In the Extension APIs for Windows 10 devices part, you could see that only a few functions come from user32.dll could be used in UWP apps and the MessageBox function is not listed.
Thank you.