Stuff onion slices into a pint-size Mason jar. Pour some of the boiling water over the onions. Let rest for 10 seconds. Pour out water through a mesh strainer, keeping onions in the jar. Repeat twice more to cook onions slightly.
Measure vinegar into a bowl. Stir in salt and sugar until dissolved. Add peppercorns. Pour vinegar solution over onions. Seal and shake well.
Refrigerate at least 1 hour before serving so that the flavor develops.