In general the values you pass to glVertex2d (note: the ‘d’ suffix here is to indicate you pass ‘double’ values instead of floats, not that you are drawing in window coordinates) are in object space coordinates. The location that gets drawn on your screen depends on the current modelview and projection matrices as well as on your viewport setup.
How do you set up modelview, projection and viewport?
You can adjust the ortho border values to align the edges of the viewport to specific numerical values, but also understand that rendering is a binary thing. If you’re pixel center is out be epsilon it will not hit the pixel on a polygon edge if exactly aligned, for lines the fill rules are naturally different and it should touch the pixel.
This ‘correct’ way to align this is to adjust the ortho values.