This is not straight forward with xPDO unless you have knowledge of the core of the extra in this case.
To build xPDO query you have to view the XML file that comes with the extra to see the object names, optionally you can check the /model/gallery/ directory for the class names to query at.
xPDO constructs query based on the actual class objects and not the table names. The query itself is pretty simple:
$galleries = $modx->getCollection('Gallery');
foreach($galleries as $gallery) {}
With exception that I do not remember the real names of the classes top of me head.
I do encourage to join the "xPDO" family which can take bit of time, but you can read how to build queries from the RTFM, my site or Bob's site. Mine and RTFM can most likely answer quite lot of questions right now. And am trying to finalize the next chapter for lazybook which will have quite lot of SQL queries turned to xPDO queries.
If you want to get objects with xPDO query, you can use xPDOCriteria object to build the query and you can find example from my site, a small article that was my first xPDO related article.