Strong odd coloring of sparse graphs