Specifically in regards to Android. The OpenXR sample code in https://github.com/meta-quest/Meta-OpenXR-SDK uses gettid to get the thread id before passing it to xrSetAndroidApplicationThreadKHR. As another example, in ovr_sdk, the tid is passed to vrapi_SetPerfThread.
So it's accurate to use gettid on Android