The main character is surely Gintoki Sakata. He's the central figure in the Gintama series and would likely play a crucial role in the 'Ending Story' as well.
Typically, there would be the students of Class 3 - Z. However, without reading it in detail, it's hard to say exactly who the main characters are among them. But it's likely that there are some standout students who take the lead in the various adventures and storylines.
I recommend the book "Possibly a Fake Silver Soul". It tells the story of Jiang Cheng, a transmigrator, who met the owner of Xinghai District and his girlfriend, Jiang Hua, who were traveling in the universe in the dragon vein of a certain planet. Later, he came to Earth and met his teacher, Yoshida Shoyo, who had influenced his life. He also met a group of friends. This included the transmigrator Okita Soki. This is a Silver Soul Doujinshi novel, don't miss it. I hope you like this fairy's recommendation. Muah ~😗
The 'Attack on Titan' characters would be quite shocked by the technology and the general chaos in the 'Gintama' world. Characters like Armin would be very interested in all the strange inventions and the way society functions in 'Gintama'. He might try to understand the economic and political systems there. And the 'Gintama' characters would be in awe of the 'Attack on Titan' characters' ability to fight Titans. They could team up to face common enemies or just have a series of comical misunderstandings that lead to all sorts of adventures.
Gintama is purely fictional. It's filled with imaginative characters and scenarios that are not rooted in real-life events. The creators crafted a unique and entertaining fictional world for the audience.