I know I nned test the Google in-app purchase of an app in a real mobile phone.
Can I use Android Studio emulator to test Google in-app purchase when I publish the app to Internal test track of Google Play?
Yes, it is no different than with a physical device.
Just make sure your emulator is running an Android OS with Play Services. You can then open Play Store on it, log in with your Google Account (the one in the Internal test track) and then you can test the in-app purchase.
You can learn more about how to test this here. Relevant steps for setting up a device (including an emulator) can be found here.