The president mocked Trump at the event over the Celebrity Apprentice star's potential political bid and his questioning of Obama's US citizenship.
However, while the remarks were made in jest, Trump later described the jibes as "inappropriate".
During an appearance on Conan, Hamm revealed that he attended the dinner and was highly amused by Obama's speech, as was the Mad Men star's seat mate Zach Galifianakis.
"[Obama] was amazing. And I had kind of the best seat in the house because I was sitting sort of right behind Donald Trump's table. And watching that dude, who has no problem telling people what to do and giving people trouble - he didn't take it very well. Laugh!" he recalled.
"That was a rough table. I was actually sitting next to Zach Galifianakis and we were laughing very loudly to the point where I kind of checked in with him and I was like, 'Can we kind of tone it down? These are funny jokes but he's right there'."
Watch Jon Hamm's interview on Conan below: