Get node internal path from path alias in Twig template
You should not be running Drupal functions inside TWIG templates, the best approach is to use a pre-processor as mentioned in the comments. You can do this by setting a variable inside a hook being called either in your theme file or custom module and setting like this:

$vars['your_custom_variable'] = $unaliasedNodePath


And then inside your twig template you can use the variable set in your pre-processor like this:

{{ your_custom_variable }}


More information can be found here: 

https://www.drupal.org/docs/8/theming/twig/twig-best-practices-preprocess-functions-and-templates