Both are military, but the Yugo is a little shorter.
Yugo, military karabiner based on mauser k98 design, is with shorter action, sufficient for 57 mm casing. (this rifle is designated as m48)
Comercial Yugo mauser, for hunting, known as m70 is with longer action. (standard action)
I’ve seen rifles here and elsewhere with Mauser actions chambered for much larger rounds than the 8mm Mauser
Regarding the case lenghts,
If you check the cartridge history, you will see that 9.3x62, 9.3x64, 8x68, all great German hunting cartridges are designed to fit on mauser 98 standard military action.
So, 98 can accommodate quite long cartridges
458 Win mag was made to fit standard winchester m70 long action, overall lengt of cartridge is 3.34''.
I think that this can be considered as maximum for today standard for cartridge length in bolt action mauser98 type rifles, which are not in magnum action size. (long actions)
I suppose that cartridges slightly longer that that, can still fit to long action today, but will need some adjustment and modification to fit in standard action length. (actually this is for gunsmiths to comment)