Accepted answer has some flaws:
At least on my tenant all aplication IDs are version 4 GUIDs.
`if two requests for a GUID are made in rapid succession ... the uniquifier is incremented so that GUIDs generated from the “second time it was five o’clock” don’t collide with those generated “the first time it was five o’clock”.`
Quoted documentation snippet does not answer OP's question
---
My answer based onb multi-tenancy logic: Entra ID backend assigns guid and handles potential collisions.
Reasoning: all multi-tenancy service principal onboarding prosesses only take application id as input:
/adminconsent
/authorize with implicit service principal creation
Graph calls to create a new service principal