PRIMARY OBJECTIVES:
I. To measure the relative changes in cell cycle-related genetic signature of the tumor microenvironment post administration of neoadjuvant nivolumab in children and young adults with recurrent or progressive HGG when compared to a cohort of archived non-treated recurrent pediatric HGG samples.
II. To characterize the safety and tolerability of neoadjuvant nivolumab followed by adjuvant nivolumab in children and young adults with recurrent or progressive HGG.
SECONDARY OBJECTIVES:
I. To determine the 6 month and 12 month overall survival (OS) in children and young adults with recurrent or progressive HGG treated with neoadjuvant nivolumab followed by adjuvant nivolumab.
II. To determine the 6 month and 12 month progression-free survival (PFS) in children and young adults with recurrent or progressive HGG treated with neoadjuvant nivolumab followed by adjuvant nivolumab.
EXPLORATORY OBJECTIVES:
I. To measure relative changes in interferon gamma associated genetic signature within the tumor microenvironment post administration of neoadjuvant nivolumab in children and young adults with recurrent or progressive HGG compared to archived non-treated recurrent pediatric HGG samples.
II. To explore the correlation of interferon-gamma-associated genetic signature, cell cycle-related genetic signature and infiltrating T lymphocyte (TIL) density and clonality with clinical responses.
III. To measure TIL density post administration of neoadjuvant nivolumab in children and young adults with recurrent or progressive HGG.
IV. To estimate the objective response rate (ORR) in children and young adults with recurrent or progressive HGG treated with neoadjuvant nivolumab followed by adjuvant nivolumab.
V. To evaluate the association between advanced MRI parameters (ADC on DWI, rCBV on dynamic susceptibility contrast (DSC) perfusion MRI, pre-contrast T1 shortening on T1-weighed images, and/or MTRasym on pH-Weighted Amine CEST-EPI) and tumor and peripheral blood immune responses.
VI. To measure relative change in peripheral T-cell response and post administration of neo-adjuvant nivolumab in children and young adults with recurrent or progressive HGG.
VII. To measure PD-1 and PDL-1 expression by immunohistochemistry for children and young adults with recurrent or progressive HGG post neoadjuvant nivolumab and evaluate the differences between the treatment cohort and archived non-treated recurrent pediatric HGG samples.
VIII. To explore the correlation of tumor mutational load with clinical response for children and young adults with recurrent or progressive HGG treated with neoadjuvant nivolumab followed by adjuvant nivolumab.
IX. To assess Quality of Life (QOL) and cognitive measures in children and young adults with recurrent or progressive HGG treated with neoadjuvant nivolumab followed by adjuvant nivolumab.
X. To assess patient and/or proxy satisfaction with study participation via patient-reported outcome (PRO) measures in the context of race ethnicity and other health related social risks.
XI. To assess on therapy toxicity in the context of race, ethnicity and other health related social risks.
OUTLINE: Neoadjuvant nivolumab followed by adjuvant nivolumab evaluation.
NEOADJUVANT TREATMENT: Participants will receive a single infusion of nivolumab of 3 mg/kg 14± 5 days prior to surgery. When scheduling, please keep in mind that the two pre-surgical plasma samples (day of neoadjuvant dose and day of surgery) should be drawn greater than 10 days apart.
Tumor samples will be obtained at time of surgery. The tissue from this surgery (fresh, frozen and FFPE) and the archived tissue (FFPE) from the most recent surgery prior to registration revealing HGG will be processed so as to best achieve the primary, secondary and exploratory objectives.
ADJUVANT TREATMENT: Infusion Cycle #1 should begin as soon as participant has recovered from surgery and has been tapered off of steroids. A maximum dexamethasone dose of 0.1 mg/kg/day is allowed, but preferably have been discontinued (inhaled or topical use of steroids is allowed).
Maintenance Cycle 1+ Day 1 \& 15: Participants will receive nivolumab (3mg/kg) IV every 2 weeks until progression or development of unacceptable toxicities or withdrawal. Blood samples will be obtained as pharmacodynamic markers throughout the study (Day 1 of every other cycle). Dose interruptions and symptomatic management will occur based upon preset adverse event determination.
After completion of study treatment, patients are followed up at 30 days and then every 2 months for up to 5 years.
Inclusion Criteria:
1. Participants with recurrent or progressive high-grade gliomas (HGG) (World Health Organization (WHO) grade III or grade IV) who are candidates for surgical tumor debulking will be enrolled in this trial
2. All assessments are to occur within 14 days of registration except where otherwise noted. The participant and their legal parent/guardian must be thoroughly informed about all aspects of the study, including the study visit schedule and required evaluations and all regulatory requirements for informed consent. The written informed consent must be obtained from the participant and legal parent/guardian prior to enrollment
3. Have a history of previously treated histologically confirmed World Health Organization grade III or IV HGG. Previous first line therapy with radiation and/or chemotherapy
4. Have evidence of recurrence or progression of disease by MRI scan
5. Participants must be adequate medical candidates for surgical resection. The intent of surgical resection is to allow both cytoreduction and tumor debulking as part of standard of care, and also collect a minimum of 100 mg of tumor tissue for the study tissue endpoints
6. A primary goal of surgery must be cytoreduction, and not solely on diagnostic biopsy
7. Age: Participants must be \> 6 months and \< 25 years of age at time of enrollment
8. 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
9. Patients with neurological deficits should have deficits that are stable for a minimum of 1 week prior to enrollment (on stable or tapering dosing of steroids). A baseline detailed neurological exam should clearly document the neurologic status of the patient at the time of enrollment on the study.
10. Prior Therapy: Participants must have fully recovered from the acute toxic effects of all prior anti-cancer therapy and must meet the following minimum duration from prior anti-cancer directed therapy prior to enrollment. If after the required timeframe, the defined eligibility criteria are met, e.g. blood count criteria, the patient is considered to have recovered adequately
* Cytotoxic chemotherapy or other anti-cancer agents known to be myelosuppressive. At least 21 days after the last dose of cytotoxic or myelosuppressive chemotherapy (42 days if prior nitrosourea)
* An interval of at least 12 weeks from the completion of radiation therapy to registration unless there is unequivocal histologic confirmation of tumor progression
* Hematopoietic growth factors: At least 14 days after the last dose of a long-acting growth factor (e.g. pegfilgrastim) or 7 days for short acting growth factor. For agents that have known adverse events occurring beyond 7 days after administration, this period must be extended beyond the time during which adverse events (AEs) are known to occur. The duration of this interval must be discussed with the study chair.
* Had their last dose of biologic (anti-neoplastic agent) ≥7 days prior to study registration, or beyond the time during which AEs are known to occur.
* Anti-cancer agents not known to be myelosuppressive (e.g. not associated with reduced platelet or absolute neutrophil count \[ANC\] counts): At least 7 days after the last dose of agent
* Interleukins, interferons and cytokines (other than hematopoietic growth factors): \>= 21 days after the completion of interleukins, interferon or cytokines (other than hematopoietic growth factors)
* Antibodies: \>= 21 days must have elapsed from infusion of last dose of antibody, and toxicity related to prior antibody therapy must be recovered to grade =\< 1
* An interval of at least 12 weeks from prior exposure to PD-1 or PD-L1 inhibitors.
* Stem cell infusion (with or without total-body irradiation (TBI)):
* Autologous stem cell infusion including boost infusion: \>= 42 days
11. Participants must be willing to forego cytotoxic anti-tumor therapies except study-defined therapy while being treated on study
12. Organ Function Requirements:
* Peripheral absolute neutrophil count (ANC) \>= 1000/mm\^3
* Platelet count \>= 100,000/mm\^3
* Creatinine clearance or radioisotope glomerular filtration rate (GFR) \>= 70 mL/min/1.73 m\^2 OR a serum creatinine based on age/gender as follows:
* Age: Maximum Serum Creatinine (mg/dL)
* 6 months to \< 3 years: 0.6 (male and female)
* 3 to \< 6 years: 0.8 (male and female)
* 6 to \< 10 years: 1 (male and female)
* 10 to \< 13 years: 1.2 (male and female)
* 13 to \< 16 years: 1.5 (male), 1.4 (female)
* \>= 16 years: 1.7 (male), 1.4 (female)
* Bilirubin (sum of conjugated and unconjugated) =\< 1.5 x upper limit of normal (ULN) for age (except participants with Gilbert syndrome who must have a total bilirubin level of \< 3.0
* Aspartate aminotransferase (AST)/alanine aminotransferase (ALT) =\< 3.0 x ULN
* Serum albumin \>= 2
13. Pregnancy: The effects of nivolumab on the developing human fetus are unknown. For this reason women of child-bearing potential must agree to use adequate contraception (hormonal or barrier method of birth control; abstinence) prior to study entry, for the duration of study participation and 5 months after completion of therapy. Should a woman become pregnant or suspect she is pregnant while she or her partner is participating in this study, she should inform her treating physician immediately.
14. MRI within 28 days prior to registration.
Exclusion Criteria:
1. Current or planned participation in a study of an investigational agent or using an investigational device.
2. Has a diagnosis of immunodeficiency.
3. Has tumor primarily localized to the brainstem or spinal cord.
4. Has presence of diffuse leptomeningeal disease or or disseminated/multi-focal disease, or extracranial disease.
5. Has received systemic immunosuppressive treatments (such as methotrexate, chloroquine, azathioprine, etc.), aside from anti-neoplastic chemotherapy or systemic corticosteroids within six months of registration.
6. Participants with a concurrent condition requiring systemic treatment with either corticosteroids (\> 0.25 mg/kg daily prednisone equivalent) or other immunosuppressive medications within 14 days of start of study treatment. Inhaled or topical steroids, and adrenal replacement steroid doses \> 0.25 mg/kg daily prednisone equivalent, are permitted in the absence of active autoimmune disease.
7. Unable to taper steroids due to ongoing mass effect; a maximum dexamethasone dose of 0.1 mg/kg/day is allowed (4mg maximum), but preferably have been discontinued (inhaled or topical use of steroids is allowed).
8. Has a known history of active TB (Bacillus tuberculosis).
9. Has a known additional malignancy that is progressing or requires active treatment within 3 years of registration. Exceptions include basal cell carcinoma of the skin, squamous cell carcinoma of the skin, or in situ cervical cancer that has undergone potentially curative therapy.
10. Has active autoimmune disease that has required systemic treatment in the past 2 years (i.e. with use of disease modifying agents, corticosteroids or immunosuppressive drugs). Replacement therapy (e.g. thyroxine, insulin, or physiologic corticosteroid replacement therapy for adrenal or pituitary insufficiency, etc.) is not considered a form of systemic treatment.
11. Has known history of, or any evidence of active non-infectious pneumonitis.
12. Has an active infection requiring systemic therapy.
13. Has a known hypersensitivity to any of the study therapy products.
14. Has a known history of positive test for human immunodeficiency virus (HIV) or known acquired immunodeficiency syndrome (AIDS).
* NOTE: Testing for HIV must be performed at sites where mandated locally
15. Any prior positive test result for hepatitis B virus or hepatitis C virus indicating presence of virus, e.g., hepatitis B surface antigen (HBsAg, Australia antigen) positive, or hepatitis C antibody (anti-HCV) positive (except if HCV-ribonucleic acid (RNA) negative).
16. Participants who have had prior allogenic hematopoietic stem cell transplant (HSCT).
17. Any serious or uncontrolled medical disorder that, in the opinion of the investigator may increase the risk associated with study participation or study drug administration, impair the ability of the participant to receive protocol therapy or interfere with interpretation of study results.