Given the details of your problem, the root issues are your expectations and your source.
First, the HP M477 is an office laserjet printer. It is great for simple documents and middling outputs. It is not for use in a production printshop or a serious desktop publishing environment. It was not designed for that purpose, and it therefore does not have the features to handle that.
Second, the Universal Print Driver tends to have an acceptable selection of basic functions covering the vast majority of normal office needs. It lacks detailed features for specific devices, though. You may have some or limited success if you were to try using the device-specific drivers rather than the UPD. However, the driver does not change the hardware specifications of the printer. It may only provide additional scaling options which will are likely to continue to skew your prints.
Third, if you were to attempt to change your driver, you should consult with your local IT persons. This printer is unlikely to be running in your home office, and so I'd wager you're at your office and someone else has chosen to deploy the printer to your computer using the UPD. If this is the case, you should speak with them before doing anything further.
Fourth, as others have mentioned in the comments, the native resolution of the printer does not divide neatly into the DPI of your source and so your output will always be skewed using the devices you have mentioned. While you may wish the source to be sacrosanct, considering you cannot change the printer, that only leaves the source as the viable change-option.
1Why wouldn't you increase your image resolution to match your calculated printer resolution? Scaling by different horizontal and vertical dimensions could produce a worse image than maintaining the correct aspect ratio. – Mokubai – 2017-01-15T18:43:05.617
Because that would require repeating every single time I print. – Frank Razenberg – 2017-01-15T18:51:34.973
What's wrong with regular 'fit to page' & why distort the output, why not fix the input? – Tetsujin – 2017-01-15T19:23:08.000
It's not the input that's wrong! The printed result doesn't match the design precisely. – Frank Razenberg – 2017-01-15T19:32:54.893
@FrankRazenberg then perhaps you need to tell us more clearly about the actual problem you are trying to fix. You can edit your question to explain what is wrong. – Mokubai – 2017-01-15T19:48:39.520
I believe the description is accurate: inaccuracy in the printer itself causes the printed document to be slightly off-scale. A design of 20x25cm comes out at 19.90x24.95cm, which is entirely due to printer inaccuracy. – Frank Razenberg – 2017-01-15T22:33:41.903
1'inaccuracy'... you're trying to persuade a device that runs at multiples of 300 dpi to be perfectly accurate at 254dpi. Fix your artwork & you will fix your results. – Tetsujin – 2017-01-16T07:25:20.163
More or less what @Tetsujin said. You are expecting an average office-class printing device to have a level of precision reserved for serious printshop or desktop publishing needs. You MAY get better settings if you use the device-specific driver rather than the UPD, but the root issue in this circumstance is still your expectations and your source. – music2myear – 2017-01-25T22:28:23.877