You can install GOG games the same way you do on any Linux desktop from the Deck's handheld mode (usually through Lutris or Heroic). After that, you add the games to Steam as a "non-Steam game" and it'll show up in handheld mode just like any Steam game.
Installing new GOG games from the GOG library isn't quite as easy as installing Steam games is, and you don't get the extra testing and verification for running games on Linux that you get on the Deck.
You do get all of the benefits from the Steam UI, though, like controller remapping and game specific performance profiles.