The TIN (or PESEL in the case of Poland) definitely does not get assigned automatically. It is usually assigned at the time of your first contact with the tax office. If you are a foreigner, you also should have a residential address in the country.
If you are e.g. someone born in Qatar to Polish parents, you are eligible for Polish passport (definitely not Qatari btw), if you are baby that was just born, you do not have a PESEL number.
However in the end it doesn't really matter, what really matters is your residence and not your citizenship (with the exception of USA, Eritrea and Hungary) as Gediminas already correctly mentioned. The country doesn't have such powers over you, it is no longer a soviet republic with barbed fence at the borders.