While he doesn't have the same voice as Tom Hanks, he does share a similar deep, resonant voice that can sound familiar to some people. He has a recognizable voice and has done a lot of voice acting and commercials, so it's easy to see how he could be mistaken for someone like Tom Hanks.
If you can give me more details about the commercial you're thinking of, I might be able to identify it and confirm if it's indeed Jon Hamm.