Yes, this would be possible with the c++ target. Take a look at this post: Is there a way to expose a Haxe library as a library for another target - #2 by dmitryhryppa
I imagine you could make a shared library with any target you want, it would just take a bit of effort to figure out. For example the JVM target can be compiled to native code with GraalVM.
Embedding the LuaVM or Hashlink could probably work too.