Eligibility Criteria:
--COHORTS 1, 2, AND 3 CLOSED---
INCLUSION CRITERIA:
COHORT 1A AND 1B:
* New diagnosis of DMG with imaging and/or pathology consistent with a DMG, including spinal cord tumors. In cohort 1B, previous tumor tissue confirmation of DMG is mandatory and pathology must be consistent with a DMG including diffuse midline glioma Histone 3 lysine 27 - mutant (H3K27M); World Health Organization (WHO) grade III and IV H3 wildtype gliomas.
* Must be within 6 weeks of diagnosis to begin standard of care radiation therapy on study.
COHORT 2A AND 2B:
* Diagnosis of DMG with imaging and/or pathology consistent with a DMG, including spinal cord tumors, who have complete standard-of-care radiation therapy. In Cohort 2B, previous tumor tissue confirmation of DMG is mandatory and pathology must be consistent with a DMG including diffuse midline glioma H3K27M mutant; WHO grade III and IV H3 wildtype gliomas.
* Participants must be within 4-14 weeks of completion of radiation. Radiation should have started within 6 weeks of diagnosis.
COHORT 3A AND 3B:
* Diagnosis of recurrent DMG with imaging and/or pathology consistent with a DMG, including spinal cord tumors, who have complete standard-of-care radiation therapy. In cohort 3B, previous tumor tissue confirmation of DMG is mandatory and pathology must be consistent with a DMG including diffuse midline glioma H3K27M mutant; WHO grade III and IV H3 wildtype gliomas.
* Participants must have evidence of progression and not have received any treatment for this progression and have not previously received re-irradiation.
COHORT 4A AND 4B:
* Diagnosis of DMG with imaging and/or pathology consistent with a DMG, including spinal cord tumors. In cohort 4B\^1, previous tumor tissue confirmation of DMG is mandatory and pathology must be consistent with a DMG diffuse midline glioma H3K27-altered.
* Not currently eligible for any other clinical trials that include administration of ONC201.
Cohort 4A\^1 and 4B\^1 (participants with newly diagnosed DMG prior to radiation): Must be able to begin standard of care radiation therapy on study within 6 weeks of diagnosis.
Cohort 4A\^2 and 4B\^2 (participants with newly diagnosed DMG who have completed radiation): Participants must be within 4-14 weeks of completion of radiation and not have received additional therapy beyond completion of radiation therapy. Radiation should have started within 6 weeks of diagnosis.
Cohort 4A\^3 and 4B\^3 (participants with DMG at progression): Participants must have evidence of progression and not have received any treatment for this progression and have not previously received re-irradiation.
COHORT 5
* Diagnosis of DMG with imaging and/or pathology consistent with a DMG, including spinal cord tumors. In cohort 5\^1, previous tumor tissue confirmation of DMG is mandatory and pathology must be consistent with a DMG diffuse midline glioma H3K27-altered.
* Not currently eligible for any other clinical trials that include administration of ONC201.
* Multifocal and leptomeningeal disease will be eligible for Cohort 5.
* Participant's tumor must demonstrate one of the following molecular alterations considered targetable by an approved agent:
* BRAFV600E
* PDGFRA (DNA point mutation or amplification with \>=5 copy numbers)
* FGFR1 (DNA point mutation, gene fusions, or amplification with \>=5 copy numbers)
* NF1
Cohort 5\^1 (participants pre-radiation): Must be able to begin standard of care radiation therapy on study within 6 weeks of diagnosis.
Cohort 5\^2 (participants post-radiation): Participants must be within 4-14 weeks of completion of radiation and not have received additional therapy beyond completion of radiation therapy. Radiation should have started within 6 weeks of diagnosis.
Cohort 5\^3 (participants with progression): Participants must have evidence of progression and not have received any treatment for this progression and have not previously received re-irradiation.
All Cohorts (except Cohort 6):
* Age 2 to 39 years
* Participants must have recovered from all acute side effects of prior therapy and be beyond the window for expected ongoing acute toxicities. Any number of prior therapies are allowed.
* Prior ONC201 exposure is allowed, except in participants who have participated in Chimerix trials investigating ONC201 in the upfront setting. Participants who participated in trials investigating ONC201 in the upfront setting will not be eligible at any time, with the exception if participants received ONC201 as part of PNOC022 or other expanded access programs such as German sources of ONC201.
* Participant body weight must be above the minimum necessary for the participant to receive ONC201 (at least 10 kilograms (kg))
* From the projected start of scheduled study treatment, the following time periods must have elapsed: At least 7 days after last dose of a biologic agent or beyond time during which adverse events are known to occur for a biologic agent, 5 half-lives from any investigational agent, 4 weeks from cytotoxic therapy (except 23 days for temozolomide and 6 weeks from nitrosoureas), 6 weeks from antibodies (21 days for bevacizumab when used for tumor-directed therapy, guidance on use for pseudo-progression is below), or, or 4 weeks (or 5 half-lives, whichever is shorter) from other anti-tumor therapies.
o The use of bevacizumab to control radiation therapy-induced edema is allowed (if used for tumor-directed therapy, please see required time period above).
* Dosing limitations are as follows:
* \* Bevacizumab (or equivalent) for up to a maximum of 5 doses, dosing per institutional standard. There is no required washout period.
* Prior use of temozolomide during radiation at maximum of the standard pediatric dosing (defined as 90 mg/m2 /dose continuously during radiation therapy for 42 days) or dexamethasone is allowed. Any other agent given throughout radiation therapy must be discussed with the study chairs prior to beginning the agent.
* Corticosteroids: Participants who are receiving dexamethasone must be on a stable or decreasing dose for at least 3 days prior to baseline magnetic resonance imaging (MRI) scan.
* The participant must have adequate organ function defined as:
* Peripheral absolute neutrophil count (ANC) \>= 750/mm\^3 (1.0g/l) AND
* Platelet count \>= 75,000/mm\^3 (100x10\^9/l) (transfusion independent, defined as not receiving platelet transfusions for at least 7 days prior to enrollment).
* Creatinine clearance or radioisotope glomerular filtration rate (GFR) \>= 70 mL/min/1.73 m\^2 OR
* A serum creatinine within the normal limits for age
* Bilirubin (sum of conjugated + unconjugated) =\< 1.5 x upper limit of normal (ULN) for age AND
* Serum glutamate pyruvate transaminase (SGPT)(alanine aminotransferase (ALT)) =\< 3 x ULN AND
* Serum albumin \>= 2 g/Dl
* No evidence of dyspnea at rest, no exercise intolerance due to pulmonary insufficiency, and a pulse oximetry of \> 92% while breathing room air.
* Diarrhea \< grade 2 by Common Terminology Criteria for Adverse Events (CTCAE) version (v) 5.0
* No history of congestive heart failure or family history of long QT syndrome.
* ECG must be obtained to verify the Corrected QT Interval (QTc). If an abnormal reading is obtained, the ECG should be repeated in triplicate. QTC \< 470 msec.
* Participants with history of congestive heart failure, at risk of having or have underlying cardiovascular disease, or with history of exposure to cardiotoxic drugs must have adequate cardiac function as determined by echocardiogram. Shortening fraction of \>= 27%.
* Participants with seizure disorder may be enrolled if seizure disorder is well controlled
* Females of child-bearing potential and males must agree to use adequate contraception.
* Karnofsky \>= 50 for participants \> 16 years of age and Lansky \>= 50 for participants =\< 16 years of age. Participants who are unable to walk because of paralysis, but who are up in a wheelchair, will be considered ambulatory for the purpose of assessing the performance score.
* Participants must be willing to provide adequate tissue. A minimum of 10-20 paraffin embedded unstained slides OR 1 block with tumor content of 40% or greater is required. Frozen tissue is also acceptable.
COHORT 6 Inclusion Criteria:
* Diagnosis of newly diagnosed thalamic or pontine located DMG with imaging and/or pathology consistent with a DMG, excluding spinal cord tumors, who have completed standard-of-care radiation therapy. If archival tissue is available prior to first biopsy, participants must be willing to provide adequate tissue. A minimum of 10-20 paraffin embedded unstained slides OR 1 block with tumor content of 40% or greater is required.
* Participants must be within 4-14 weeks of completion of radiation. Radiation should have started within 6 weeks of diagnosis.
* Age 2-39 years.
* Prior use of temozolomide during radiation at maximum of the standard pediatric dosing (defined as 90 mg/m2 /dose continuously during radiation therapy for 42 days) is allowed. Any other agent given throughout radiation therapy must be discussed with the study chairs prior to enrollment.
* Participants must have recovered from all acute side effects of prior therapy and be beyond the window for expected ongoing acute toxicities. Washout requirements from prior therapy include:
* At least 7 days after last dose of a biologic agent or beyond time during which adverse events are known to occur for a biologic agent, 5 half-lives from any investigational agent, 4 weeks from cytotoxic therapy (except 30 days for temozolomide and 6 weeks from nitrosoureas), 6 weeks from antibodies (28 days for bevacizumab when used for tumor-directed therapy, guidance on use for pseudo-progression is below), or 4 weeks (or 5 half-lives, whichever is shorter) from other anti-tumor therapies.
* At least 4 weeks prior to study enrollment from last immune therapy
* Corticosteroids: Participants treated with corticosteroids must be on stable or decreasing dose for at least 1 week prior to enrollment, with maximum dexamethasone dose 0.1 mg/kg/day dexamethasone equivalent at time of enrollment.
* The participant must have adequate organ function defined as:
* Peripheral absolute neutrophil count (ANC) \>= 750/mm3 (1.0g/l) and
* Platelet count \>= 75,000/mm3 (100x109/l) (transfusion independent, defined as not receiving platelet transfusions for at least 7 days prior to enrollment.
* Creatinine clearance or radioisotope GFR \>= 70mL/min/1.73 m2 or
* A serum creatinine within the normal limits for age.
* Total bilirubin \<= 3 x upper limit of normal (ULN); in presence of Gilbert's syndrome, total bilirubin \</= 6 x ULN or direct bilirubin \<= 3 x ULN
* ALT \<= 5 x ULN
* AST \<= 5 x ULN.
* Serum albumin \>= 2 g/dL
* Diarrhea \< grade 2 by CTCAE v5.0.
* No history of congestive heart failure or family history of long QT syndrome.
* Participants with seizure disorder may be enrolled if seizure disorder is well controlled.
* The effects of the study drugs on the developing human fetus are unknown. For this reason, females of child-bearing potential and males must agree to use adequate contraception.
* Karnofsky \>/= 70 for Participants \> 16 years of age and Lansky \>/= 70 for participants \</= 16 years of age. Participants who are unable to walk because of paralysis, but who are up in a wheelchair, will be considered ambulatory for the purpose of assessing the performance score
EXCLUSION CRITERIA:
COHORT 1A AND 1B:
* Prior exposure to radiation therapy.
* Thalamic and Cerebellar H3K27M DMG.
COHORT 2A AND 2B:
* For tumors that do not have a pontine or spinal cord epicenter the following specific exclusion criteria apply:
* Thalamic and Cerebellar H3K27M DMG that has undergone standard radiation without concurrent therapy (other than temozolomide).
COHORT 1A AND 2A:
• Deemed not appropriate for tissue resection/biopsy.
COHORT 3A AND 3B:
* Prior exposure to re-irradiation for tumor progression.
* Thalamic and cerebellar H3K27M mutant DMG.
COHORT 4A AND 4B:
Cohort 4A\^1and 4B\^1: Prior exposure to radiation therapy Cohort 4A\^3 and 4B\^3: Prior exposure to re-irradiation for tumor progression
* Thalamic and cerebellar H3K27M mutant DMG, except those who received ONC201/ONC026 from alternative source prior to 2024 or US patients enrolled while the accelerated approval new drug application for dordaviprone to treat recurrent H3 K27M-mutant diffuse glioma is under review by US FDA.
* Cohort 4A\^1and 4B\^1: Prior exposure to radiation therapy
* Cohort 4A\^3 and 4B\^3: Prior exposure to re-irradiation for tumor progression
COHORT 5:
* Thalamic and cerebellar H3K27M mutant DMG, except those who received ONC201/ONC026 from alternative source prior to 2024 or US patients enrolled while the accelerated approval new drug application for dordaviprone to treat recurrent H3 K27M-mutant diffuse glioma is under review by US FDA.
* Cohort 5\^1: Prior exposure to radiation therapy
* Cohort 5\^3: Prior exposure to re-irradiation for tumor progression
All Cohorts (except Cohort 6):
* Diagnosis of a histone H3 wildtype grade II diffuse astrocytoma.
* Participants who are currently receiving another investigational drug. Investigational imaging agents or agents used to enhance tumor visibility on imaging or during tumor biopsy/resection should be discussed with the study chairs.
* Participants who are currently receiving other anti-cancer agents.
* Participants with a known disorder that affects their immune system, such as human immunodeficiency virus (HIV) or hepatitis B or C, or an auto-immune disorder requiring systemic cytotoxic or immunosuppressive therapy. Note: Participants that are currently using inhaled, intranasal, ocular, topical or other non-oral or non-intravenous (IV) steroids are not necessarily excluded from the study but need to be discussed with the study chair.
* Participants with uncontrolled infection or other uncontrolled systemic illness.
* Female participants of childbearing potential must not be pregnant or breast-feeding. Female participants of childbearing potential must have a negative serum or urine pregnancy test prior to the start of therapy (as clinically indicated).
* Active illicit drug use or diagnosis of alcoholism.
* History of allergic reactions attributed to compounds of similar chemical or biologic composition as the agents used in study.
* Evidence of disseminated disease, including diffuse leptomeningeal disease or evidence of CSF dissemination, with the exception of Cohort 5.
* Known additional malignancy that is progressing or requires active treatment within 3 years of start of study drug.
* Concomitant use of potent CYP3A4/5 inhibitors during the treatment phase of the study and within 72 hours prior to starting study drug administration.
* Concomitant use of potent CYP3A4/5 inducers, which include enzyme inducing antiepileptic drugs (EIAEDs), during the treatment phase of the study and within 2 weeks prior to starting treatment. Concurrent corticosteroids is allowed.
COHORT 6 Exclusion Criteria:
* • DMGs located outside the thalamus and pons including bilateral thalamic tumors.
* Unacceptable anesthesia or surgery risk, as determined by the anesthesiologist or the neurosurgeon.
* Evidence of significant mass effect
* Evidence of herniation on imaging.
* Participants with a known history coagulopathy that increases risk of bleeding or a history of clinically significant hemorrhage within 12 months of registration.
* Participants must not require systemic anti-coagulation that cannot be halted for each intraoperative and perioperative biopsy time-period.
* Participants with active viral infection or who are currently receiving antiviral treatment.
* Participants with active, known, or suspected immunosuppressive disorders, such as acquired or congenital immune deficiency syndromes and autoimmune diseases.
* This virus infects cells with a deficit in the RB gene. Therefore, participants with Li-Fraumeni Syndrome or a known germ line deficit in the retinoblastoma gene or its related pathway are excluded.
* Participants must not have live or live-attenuated vaccinations within 30 days prior to DNX-2401 administration and while participating in the study. Killed vaccines are permitted.
* Participants who are currently receiving another investigational drug. Investigational imaging agents or agents used to enhance tumor visibility on imaging or during tumor biopsy/resection should be discussed with the study chairs.
* Participants with a known disorder that affects their immune system, such as HIV or Hepatitis B or C, or an auto-immune disorder requiring systemic cytotoxic or immunosuppressive therapy. Note: Participants who are currently using inhaled, intranasal, ocular, topical or other non-oral or non-IV steroids are not necessarily excluded from the study but need to be discussed with the study chair(s).
* Participants with uncontrolled infection or other uncontrolled systemic illness.
* Female participants of childbearing potential must not be pregnant or breast-feeding. Female participants of childbearing potential must have a negative serum or urine pregnancy test prior to the start of therapy (as clinically indicated).
* Active illicit drug use or diagnosis of alcoholism.
* History of allergic reactions attributed to compounds of similar chemical or biologic composition as the agents used in the study.
* Evidence of disseminated disease, including multi-focal disease, diffuse leptomeningeal disease or CSF dissemination.