The most accurate pistols use a fixed mount, not attached to the slide. The only other way, is on fixed barrel pistols, such as .22s, that have a rear sight mounted on the barrel, and those are generally long barrel types, over the sighting radius. They went from this, to extended ribs, which had both sights on it, and the rib was attached to the stationary barrel.
On larger caliber pistols, such as the Glock, which have the barrel enclosed in the slide, you'll want a side mount, that is attached to the frame. It is the only way to assure the best repeatable accuracy, as a few thousandths of an inch movement, can mean a lot at the target, the farther it is out. You can mount them on the slide, but that is with a decrease in accuracy.
I don't know what is available for Glock on these, though, to use with a red dot. You will have to look around at Brownell's or Midway, etc.