They are given prior in person and because they are important they are checked with first the person who gives them and for things like Tax the Tax Office when the bank pays any Tax on that Owners Account. In cases where the bank is directly paying Tax it's in the Account Owners best Interests to have it right or it ends up with another person's tax.
Social Security is a US Thing so I have no idea but I assume that those numbers are Public Record and easily checked however they are not really important in other parts of the world as they are not used for Identification elsewhere.
As for having Access to Tax and the like again that all depends where in the world you are but to be perfectly honest most countries tend to keep that accessibility tightly controlled so lest say you are in Australia the Tax Office doesn't give anyone Open Slather to Tax Numbers most places will never get access and of those that do they only get access because they are paying Tax for People.
So while it is a Government Thing no one except Business Paying Tax for employees or investors get any access and even then it is limited to a pay in access with no ability to check anything other than that the number that they are using actually exists. They can not however check who is connected to that Number. Even if the number doesn't exist there are only two things that happen the Access Gate that the companies are paying in through will not accept the number if it doesn't actually exist or it will go to the wrong persons account at the Tax Office with no way for those paying in to know if it has gone to the correct location.