in Orthographic views middle click used for measuring , in perspective view , when you are selecting something , notice there is a white ball in the middle of the Translation widget , if you middle click there you can change drag the pivot to anywhere you like . further you can use snapping e.g by pressing V key to snap widget to vertex .
but if deselect the mesh and reselect it , it goes back to its default position. i’m wondering if there is an option to save the modified pivot…