Hanks appeared alongside Dorsey on Periscope, Twitters service for live broadcasts, to promote the film that premiers on Wednesday at New Yorks Tribeca Film Festival.
"I played you," Hanks said, as co-stars including Emma Watson laughed. "Im not in as good a shape. I didnt exercise or eat as well as you did, but I played you."
Dorsey, laughing along, held up a hand and said, "Not me."
Earlier, while telling the bearded, T-shirt-wearing Dorsey about the executive he portrays in the film, Hanks deadpanned: "You know that hes a diabolical genius because hes got a beard. Do you find that to be the case, Jack?"
The film, which opens widely in the United States on Friday, is based on a Dave Eggers novel. The book sparked debate about the rise of social media when it was published in 2013.
The fictional company at the center of the film and the book is obsessed with getting people to share their daily activities publicly. Reviewers have made comparisons to Alphabet Incs Google, Facebook Inc and Twitter, Reuters reported.
The films cast members said they were conflicted about technology that encourages people to share online, torn between its ability to shine a light on injustice and its threat to privacy in everyday affairs.
"The world that we live in now, with the level of transparency that were seeing, you get everything - every unkind word, every criticism," Watson said.
Patton Oswalt, who plays a tech executive in the film, asked whether people would become burned out over the next 10 years and start a mass retreat from social media.
"Its the opposite of Andy Warhols thing. In the future, everyone will be allowed to be anonymous for 15 minutes," Oswald said.