The passport as noted is only a form of identification, But customs can often check criminal backgrounds on their computers.

And beyond a passport, to enter most countries you need a visa also