Can identifiers be used to train a model?
You can use any variable during model training if this variable is available during inference time. This is the only technical restriction.
Another question is should you include this column or not. If this column is completely unique and does not have any relevant information in it then you can discard it. Also, categorical columns with high cardinality (number of unique values) might also have a negative impact.
On the other hand, if including this identifier improved the score a lot (not a random fluctuation) then there are might be more to it and you need to share more info on the dataset and used models.