On Kicad 5.x I was able to constrain a track horizontally or vertically when route from a pad. This way I was able to place vias aligned with pads that aren’t on grid.
To achieve this I click Ctrl while routing a track from a pad.
On Kicad 6.x I didn’t find any option to achieve the behavior describe above. The red arrow shows what happens most of the time and the green arrow is what I want to achieve.
EDIT: I found another post about it 90° / Vertical and horizontal only Tracks in 5.99