Trick Macbook to not recognize HDMI connection with external monitor but still mirror the screen to it
No, it does not technically make sense to send an image to the external display while at the same  time not recognizing the HDMI connection.

However what can be done is presenting an environment to the specific app where it is not told about the HDMI connection:

An easy and practical way of doing this is to run the app inside a virtual machine (using software such as VMware Fusion or Parallels Desktop).

An better, but more involved, approach is to override the specific library functions that the app uses to inform itself of the HDMI connection. The overriden functions would simply hide the fact that an external HDMI connection is made. Creating such an override usually requires programming experience in order to create what is essentially a shared library. The library could then be loaded using the environment variable DYLD_INSERT_LIBRARIES when launching the specific app.