How do I / Is it possible to execute an external PHP file / function inside WordPress?

Using the domain name in the path won’t work; you’re not trying to specify a URL, but a path to a file, be it relative or not. Using
include(ABSPATH . '../includes/header.php' )
should work.

/includes/header.php doesn’t work because the location of the blog folder doesn’t is not the root folder (/), but most likely a few levels down.

error code: 523