To make the dipping sauce, preheat the broiler to high heat. Place the tomatoes, garlic, chiles, and onion on a baking sheet. Tuck the garlic under the other vegetables so that it wont scorch. Broil, turning frequently, until well charred, about 15 minutes. Set aside to cool.
Transfer the vegetables to a food processor. Add the water and puree until smooth. Add the salt and pepper and transfer to a small bowl. Cover and, if desired, refrigerate for up to 5 days.
To make the huaraches: in a small skillet, heat the lard over low heat. Saute the ancho for 1 to 2 minutes, or until slightly softened. With a slotted spoon, transfer the chile to a blender and add the peppercorns, salt, and water. Blend to a smooth puree. In a large mixing bowl, combine the masa with the chile puree. Knead the dough together well. To test the consistency, flatten a small ball of dough between your palms. If the edges crack, add water to the dough, a Tbsp at a time, until a test piece does not crack. Set the masa aside, covered, at room temperature for 1 hour to allow the flavor to develop.
Pull off small pieces of the dough, about 1 tablespoon, and roll them with the palms of your hands into balls about 1 1/4 inches in diameter. Between 2 sheets of plastic wrap, roll or press them out into slightly thick 4-inch round tortillas. Place 1 tablespoon of the cheese on one side of each tortilla. Sprinkle on a little epazote and a pinch of salt. Fold the dough up and over to cover, then press down to seal the edges and make the tortilla evenly flat and about 1/4inchthick.
Heat a large comal cast iron comal or griddle over medium heat and brush it sparingly with a little oil.
Place as many huaraches as will fit onto the hot pan or griddle. Cook for 1 or 2 minutes on each side, turning over when one side is golden. Set the cooked huaraches aside and finish cooking the remaining huaraches in the same way . Sprinkle each with grated cheese and red onion and serve immediately, accompanied by the dipping sauce.