Instead of using MAME's stretching sliders, which will break integer scaling, create a custom crt_range adjusting the horizontal porch values, modifyingg these two options in mame.ini:
monitor custom
crt_range0 15625-16200, 49.50-65.00, 2.000, 4.700, 8.000, 0.064, 0.192, 1.024, 0, 0, 192, 288, 448, 576
Here, the numbers in black are the ones you have to play with until the picture fits the screen. Go increasing both of them by small amounts, then once the picture fits inside the tube, vary their relative size until you center it correctly. This will apply to all resolutions, not only one. Using super resolutions, although not strictly required, will help you get a more consistent centering among modes.