Yes, but only if you use pressure canning. Pressure canning helps kill microorganisms and prevents botulism bacteria from forming. Start by chopping up the onions and boiling them for about 5 minutes. Then, place them in heated, pint-sized (473.1 mL) jars and add 0.5 tsp (3 g) of salt to each container. Pour boiling water into each jar, leaving 1 in (2.54 cm) of headspace on top. Finally, remove all air bubbles before sealing the jars shut.