Yes. It is also possible to run a GUI program without a local display. Which I only mention for those looking to play with stupid '90's UNIX parlor tricks-- but since you have a Pi...
Suppose I have a big beefy VM (or a Pi) named marvin.example.com. Brain the size of a planet and it just runs xeyes, etc. You have a tiny little laptop we'll name "lappy386" (doesn't need a domain).
As long as the correct client libraries are installed, you can log into marvin with "X forwarding enabled" and start a GUI application:
user@lappy386$ ssh -X marvin.example.com
<login stuff happens>
user@marvin$ xeyes
The -X option (among other things) sets the $DISPLAY environment variable on the remote host. When the xeyes program is started, it checks $DISPLAY to figure out where to draw things on the screen. This environment variable sets the location of the X Server-- which, confusingly, runs on your laptop. The laptop "serves" a display environment to the individual program (xeyes), hence the name. The tiny little program on the giant VM hosted in a datacenter somewhere is a client to the display server on your tiny laptop at Ye Local Coffee Shoppe. This arrangement has been confusing people since Bush was vice president (H.W., obv-- I'm not that old, but seems like a safe bet).
You don't need any window manager installed for this to work. You do need whatever libraries are necessary for the X client to work (so QT/GTK/whatever and all the dependencies down to X) but you don't need an X server running locally on marvin. Which can save quite a bit of RAM, if you're into that sort of thing.
This works OK. ssh even tunnels the traffic through a handily-encrypted link. You can also find X Server implementations for annoying operating systems, e.g., windows (under Cygwin) or presumably OS X (haven't checked in a decade). The individual "draw stuff to the screen" commands are forwarded from marvin to lappy386 which is much more efficient than sending a full screen rendering. Much of the rendering is also done by lappy386, relieving some of the GUI load from marvin so it can support more clients or something.
However...
- On the modern Linux desktop, there are ways to bypass all this overhead stuff and interact directly with the graphics card. If the graphics card isn't sitting there on a local bus that doesn't always work so good.
- Any resources on the client side have to get network-transferred to the server. This used to lead to all sorts of issues (i.e., die X Font Server die), but these days mostly means lots of stuff gets downloaded by the server. Rather negating the performance advantages.
- It's 2024. Compute, memory and bandwidth are WAY cheap compared to the original X11 specification of 1987 (when an inflation-adjusted $40,000,000 would buy a Cray X-MP that probably loses out to your Pi). We have cool stuff now, like VM environments that can expose your local graphics card to a remote VM.
- It's 2024. We have better client/server architectures, and have even figured out which side is the server! Depending on the goal, you might be better off e.g., running a gdb server and connecting a modern IDE to it from your laptop. Or running a web server and letting clients render everything. If you're trying to have the Pi Just Display Some Stuff, consider editing your .xinitrc file to run just vlc / web browser / whatever and turn the Pi into an appliance.
Still, it's a fun parlor trick.