Unless it is "square cut "O" ring which I highly doubt, it was born round, and the years in the engine block put a flat side on it where it lived.
take a caliper and measure the tube indent diameter, that will be the ID, then measure the id of the bore it lives in, that will be the
OD of the "O" ring.
Go to Hwd store or other larger places that sells a selection or rings and get that size, remembering they do make different cross sections of "O" rings
if all else fails get with the "parker store"
it is prolly going to be a common size as there is no reason for something special on a dip stick tube.
Also don't expect the new one to be a loose fit, it will be tight going in the bore, so lube it,
if in doubt get several assorted sizes that are close they are usually less than a dollar.
smaller "O" usually are about 3 cents each in a quantity of 100 bag.