The way your body detects foreign cells is the same way your body detects foreign cells. It detects anything that doesn't have your, specific, randomly-generated at conception, friend-or-foe markers.

Would those markers be usable as a natural UUID?

Not the major HLA markers, no, because there's a ~25% chance it'll match for two siblings [0] and can sometimes match other relatives.

Once you start looking at even more factors, you start reinventing a regular DNA-matching test.

[0] The "Birthday Paradox" makes the odds of confusion even higher with more siblings.

[deleted]