Preheat oven to 356°F (180°C). Dissolve sugar and yeast with warm milk in a small bowl, stir well and set it aside for 5 minutes.
Combine flour, salt, egg and the milk mixture in a large mixing bowl, mix well with a spatula.
Using a stand mixer with the paddle attachment, knead on medium-high speed for 5 minutes until smooth. Add butter to it and keep kneading the dough at the same speed for 15 minutes until elastic.
Cover the dough with a cloth or plastic wrap and let rise for 1 hour or until double in size at a warm place.
After the first proof, transfer the dough to a floured surface. Gently press the dough to release the air from it. Divide the dough into three equal pieces and rest for 15 minutes with the plastic wrap covered.
Flatten and shape each dough into an oval shape with a roller pin, place two slices of both ham and cheese on it horizontally. Then, roll the dough up and pinch the seams to seal.
Cut the dough equally in the center with a dough cutter or knife, transfer them to the loaf pan with the cutting side face up. Cover and let it rise until doubled, about 1 hour.
After proofing, spread the mayonnaise over the top of the dough and sprinkle it with cheddar cheese and onion slices.
Bake for 40 minutes until the edges golden brown. Serve warm or at room temperature.