Catalysis of the reaction: a methylated nucleobase within DNA + 2-oxoglutarate + O2 = a nucleobase within DNA + formaldehyde + succinate + CO2. Catalyzes oxidative demethylation of the DNA base lesions N1- methyladenine, N3-methylcytosine, N1-methylguanine, and N3- methylthymine. Can also act of RNA.
5-formylcytosine dioxygenase activity