PRIMARY OBJECTIVES:
I. To assess the pathologic complete response (pathCR) rate following administration of neoadjuvant carboplatin, paclitaxel and radiation therapy versus neoadjuvant carboplatin, paclitaxel, radiation therapy and nivolumab in patients with a resected locoregionally advanced esophageal or gastroesophageal junction adenocarcinoma.
II. To assess the disease-free survival (DFS) following administration of adjuvant nivolumab and ipilimumab versus adjuvant nivolumab in patients with a resected locoregionally advanced esophageal or gastroesophageal junction adenocarcinoma who received neoadjuvant treatment with carboplatin, paclitaxel and radiation therapy with or without nivolumab.
SECONDARY OBJECTIVES:
I. To assess the overall survival (OS) following administration of adjuvant nivolumab and ipilimumab versus nivolumab in patients with a resected locoregional esophageal or gastroesophageal junctional adenocarcinoma who received neoadjuvant treatment with carboplatin, paclitaxel and radiation therapy with or without nivolumab.
II. To assess the disease free survival (DFS) following administration of neoadjuvant carboplatin, paclitaxel, and radiation therapy with or without nivolumab in patients with a locoregional esophageal or gastroesophageal junction adenocarcinoma.
III. To assess the toxicity associated with the administration of neoadjuvant nivolumab in combination with carboplatin, paclitaxel and radiation therapy in patients with a locoregional esophageal or gastroesophageal junction adenocarcinoma.
IV. To assess the toxicity associated with the administration of adjuvant nivolumab and ipilimumab versus adjuvant nivolumab in patients with a resected locoregional esophageal or gastroesophageal junction adenocarcinoma who received neoadjuvant treatment with carboplatin, paclitaxel and radiation therapy with or without nivolumab.
OUTLINE:
STEP I: Patients are randomized to 1 of 2 arms.
ARM A: Patients receive carboplatin intravenously (IV) and paclitaxel IV once weekly and undergo radiation therapy once daily (QD) (Monday-Friday) beginning on day 1 of each cycle. Cycles repeat every week for up to 5 weeks in the absence of disease progression or unacceptable toxicity. Patients undergo a computed tomography (CT) or positron emission tomography (PET) scan during screening and follow-up and undergo collection of blood samples throughout the trial.
ARM B: Patients receive carboplatin, paclitaxel, and radiation therapy as in Arm A. Patients also receive nivolumab IV over 30 minutes on days 1 and 15 of each cycle. Cycles repeat every week for up to 5 weeks in the absence of disease progression or unacceptable toxicity. Patients undergo a CT or PET scan during screening and follow-up and undergo collection of blood samples throughout the trial.
STEP II: Patients are randomized to 1 of 2 arms following standard of care surgery.
ARM C: Patients receive nivolumab IV over 30 minutes on day 1 of each cycle. Treatment repeats every 4 weeks for up to 13 cycles in the absence of disease progression or unacceptable toxicity. Patients undergo a CT scan and collection of blood samples throughout the trial.
ARM D: Patients receive nivolumab as in Arm C and receive ipilimumab IV over 90 minutes on day 1 of cycles 1 and 4 and day 15 of cycles 2 and 5. Treatment repeats every 4 weeks for up to 13 cycles in the absence of disease progression or unacceptable toxicity. Patients undergo a CT scan and collection of blood samples throughout the trial.
After completion of study treatment, patients are followed up every 3 months for 2 years, and then every 6 months for up to 5 years.
Inclusion Criteria:
* STEP 1 RANDOMIZATION: Patients must be age \>= 18 years
* STEP 1 RANDOMIZATION: Patients must have histologically confirmed T1N1-3M0 or T2-3N0-2M0 esophageal or gastroesophageal junctional adenocarcinoma (Siewert I and II)
* STEP 1 RANDOMIZATION: Patients must have an Eastern Cooperative Oncology Group (ECOG) performance status 0-1
* STEP 1 RANDOMIZATION: Patents must be deemed a surgical candidate by a thoracic surgeon, surgical oncologist, or surgeon who is qualified to perform an esophagectomy
* STEP 1 RANDOMIZATION: Absolute neutrophil count \>= 1,500/mcL (within less than or equal to 14 days prior to randomization)
* STEP 1 RANDOMIZATION: Platelets \>= 100,000/mcL (within less than or equal to 14 days prior to randomization)
* STEP 1 RANDOMIZATION: Total bilirubin =\< institutional upper limit of normal (ULN) (within less than or equal to 14 days prior to randomization)
* STEP 1 RANDOMIZATION: Aspartate aminotransferase (AST) (serum glutamic-oxaloacetic transaminase \[SGOT\])/alanine aminotransferase (ALT) (serum glutamate pyruvate transaminase \[SGPT\]) =\< 2.5 x institutional ULN (within less than or equal to 14 days prior to randomization)
* STEP 1 RANDOMIZATION: Serum creatinine =\< 1.5 x institutional ULN (within less than or equal to 14 days prior to randomization)
* STEP 1 RANDOMIZATION: Hemoglobin (Hgb) \>= 9 g/dL (within less than or equal to 14 days prior to randomization)
* STEP 1 RANDOMIZATION: Leukocytes \>= 3,000/mm\^3 (within less than or equal to 14 days prior to randomization)
* STEP 1 RANDOMIZATION: Patients may not have received prior chemotherapy or radiation therapy for management for this malignancy
* STEP 1 RANDOMIZATION: Patients may not have received prior immunotherapy for management of this malignancy or for any other past malignancy
* STEP 1 RANDOMIZATION: Patients must have no contraindication to receiving either carboplatin or paclitaxel chemotherapy
* STEP 1 RANDOMIZATION: Patients must have no contraindication to receiving radiation therapy
* STEP 1 RANDOMIZATION: Patients with active autoimmune disease or history of autoimmune disease that might recur, which may affect vital organ function or require immune suppressive treatment including systemic corticosteroids, must be excluded. These include but are not limited to patients with a history of immune related neurologic disease, multiple sclerosis, autoimmune (demyelinating) neuropathy, Guillain-Barre syndrome, myasthenia gravis; systemic autoimmune disease such as systemic lupus erythematosus (SLE), connective tissue disease, scleroderma, inflammatory bowel disease (IBD), Crohn's, ulcerative colitis, hepatitis; and patients with a history of toxic epidermal necrolysis (TEN), Stevens-Johnson syndrome, or phospholipid syndrome must be excluded because of the risk of recurrence or exacerbation of disease. Patients with vitiligo, endocrine deficiencies including thyroiditis managed with replacement hormones including physiologic corticosteroids are eligible. Patients with rheumatoid arthritis and other arthropathies, Sjogren's syndrome and psoriasis controlled with topical medication and patients with positive serology, such as antinuclear antibodies (ANA), anti-thyroid antibodies must be evaluated for the presence of target organ involvement and potential need for systemic treatment but should otherwise be eligible
* STEP 1 RANDOMIZATION: Patients are permitted to enroll if they have vitiligo, type I diabetes mellitus, residual hypothyroidism due to autoimmune condition only requiring hormone replacement, psoriasis not requiring systemic treatment, or conditions not expected to recur in the absence of an external trigger (precipitating event)
* STEP 1 RANDOMIZATION: Patient must NOT have previous or concurrent malignancy. Exceptions are made for patients who meet any of the following conditions:
* Non-melanoma skin cancer, in situ cervical cancer, superficial bladder cancer, or breast cancer in situ OR
* Prior malignancy completely excised or removed and patient has been continuously disease free for \> 5 years OR
* Date of last evidence of disease
* STEP 1 RANDOMIZATION: Patients must not have a condition requiring systemic treatment with either corticosteroids (\> 10 mg/day prednisone equivalents) or other immunosuppressive medications within 14 days of study drug administration. Inhaled or topical steroids and adrenal replacement doses =\< 10 mg/day prednisone equivalents are permitted in the absence of active autoimmune disease
* STEP 1 RANDOMIZATION: Patients must have adequate cardiac function including electrocardiogram (EKG) and echocardiogram for any patient with a history of congestive heart failure (CHF) or at risk because of underlying cardiovascular disease or exposure to cardiotoxic drugs
* STEP 1 RANDOMIZATION: For patients with evidence of uncontrolled CHF, myocardial infarction (MI), cardiomyopathy, or myositis, require a cardiac evaluation and clearance including lab tests and cardiology consultation (EKG, creatinine phosphokinase \[CPK\], troponin, and echocardiogram)
* STEP 1 RANDOMIZATION: Patients must not have a positive test result for hepatitis B virus surface antigen (HBV sAg) or hepatitis C virus ribonucleic acid (HCV RNA) indicating acute or chronic infection. Testing should be conducted to determine eligibility
* STEP 1 RANDOMIZATION: Patients with a known history of testing positive for human immunodeficiency virus (HIV) or known acquired immunodeficiency syndrome (AIDS) must have no detectable viral load on a stable anti-viral regimen
* STEP 1 RANDOMIZATION: Patients must not be receiving any other investigational agents
* STEP 1 RANDOMIZATION: Patients with an uncontrolled intercurrent illness such as ongoing or active infection, symptomatic congestive heart failure, unstable angina pectoris, cardiac arrhythmia or psychiatric illness/social situations that would limit compliance with study requirements will be excluded
* STEP 1 RANDOMIZATION: Patients must not be pregnant or breast-feeding due to potential harm to an unborn fetus and possible risk for adverse events in nursing infants from carboplatin, paclitaxel, ipilimumab or nivolumab
* All patients of childbearing potential must have a blood test or urine study done within 2 weeks prior to randomization to rule out pregnancy. Those enrolled on Arm B with nivolumab must agree to have a pregnancy test (minimum sensitivity 25 IU/L or equivalent units of human chorionic gonadotropin \[HCG\]) within 24 hours of starting nivolumab to rule out pregnancy
* A patient of childbearing potential is defined as anyone, regardless of sexual orientation or whether they have undergone tubal ligation, who meets the following criteria: 1) has achieved menarche at some point 2) has not undergone a hysterectomy or bilateral oophorectomy; or 3) has not been naturally postmenopausal for at least 24 consecutive months (i.e., has had menses at any time in the preceding 24 consecutive months)
* STEP 1 RANDOMIZATION: Patients of childbearing potential must not expect to conceive children by either abstaining from sexual intercourse for the duration of their participation in the study or by agreeing to use both double barrier contraception and birth control pills or implants for at least one month prior to the start of the study drug and continuing for 5 months after the last dose of study drug. Investigators shall counsel patients of childbearing potential on the importance of pregnancy prevention and the implications of an unexpected pregnancy
* STEP 2 RANDOMIZATION: Patient registration must not exceed 12 weeks from time of esophagectomy
* STEP 2 RANDOMIZATION: Patients must have a post-operative ECOG performance status of 0-2
* STEP 2 RANDOMIZATION: Absolute neutrophil count \>= 1,500/mcL (within less than or equal to 14 days prior to randomization)
* STEP 2 RANDOMIZATION: Platelets \>= 100,000/mcL (within less than or equal to 14 days prior to randomization)
* STEP 2 RANDOMIZATION: Total bilirubin =\< institutional upper limit of normal (ULN) (within less than or equal to 14 days prior to randomization)
* STEP 2 RANDOMIZATION: AST (SGOT)/ ALT (SGPT) =\< 2.5 x institutional ULN (within less than or equal to 14 days prior to randomization)
* STEP 2 RANDOMIZATION: Serum creatinine =\< 1.5 x institutional ULN (within less than or equal to 14 days prior to randomization)
* STEP 2 RANDOMIZATION: Patients must be disease free following esophagectomy as is demonstrated by having no evidence of disease on a post-surgical CT scan. Patients must also have a negative surgical margin (R0 resection)
* STEP 2 RANDOMIZATION: Patients must not have an active, known or suspected autoimmune disease or a condition requiring treatment with steroids or immunosuppressive agents. Patients are permitted to enroll if they have vitiligo, type I diabetes mellitus, residual hypothyroidism due to autoimmune condition only requiring hormone replacement, psoriasis not requiring systemic treatment, or conditions not expected to recur in the absence of an external trigger
* STEP 2 RANDOMIZATION: Patients must not have a condition requiring systemic treatment with either corticosteroids (\> 10 mg/day prednisone equivalents) or other immunosuppressive medications with 14 days of study drug administration. Inhaled or topical steroids and adrenal replacement doses \> 10 mg/day prednisone equivalents are permitted in the absence of active autoimmune disease
* STEP 2 RANDOMIZATION: Patients must not be receiving any other investigational agents
* STEP 2 RANDOMIZATION: Patients with an uncontrolled intercurrent illness such as ongoing or active infection, symptomatic congestive heart failure, unstable angina pectoris, cardiac arrhythmia or psychiatric illness/social situations that would limit compliance with study requirements will be excluded
* STEP 2 RANDOMIZATION: Patients must not be pregnant or breast-feeding due to potential harm to an unborn fetus and possible risks for adverse events in nursing infants from nivolumab or ipilimumab
* All patients of childbearing potential must have a blood test or urine study done (minimum sensitivity 25 IU/L or equivalent units of HCG) within 2 weeks prior to randomization to rule out pregnancy. All patients must also agree to have a pregnancy test (minimum sensitivity 25 IU/L or equivalent units of HCG) within 24 hours of starting nivolumab to rule out pregnancy. Those enrolled on Arm D with ipilimumab must agree to have pregnancy tests within 72 hours of each ipilimumab administration to rule out pregnancy
* STEP 2 RANDOMIZATION: Patients of childbearing potential must not expect to conceive children by either abstaining from sexual intercourse for the duration of their participation in the study or by agreeing to use both double barrier contraception and birth control pills or implants for at least one month prior to the start of the study drug and continuing for 5 months after the last dose of study drug. Investigators shall counsel patients of childbearing potential on the importance of pregnancy prevention and the implications of an unexpected pregnancy