Pembrolizumab and Vorinostat in Treating Patients With Recurrent Squamous Cell Head and Neck Cancer or Salivary Gland Cancer That Is Metastatic and/or Cannot Be Removed by Surgery

This phase I/II trial studies the side effects of pembrolizumab and vorinostat in treating patients with squamous cell head and neck cancer or salivary gland cancer that has come back, has spread to other places in the body and/or cannot be removed by surgery. Monoclonal antibodies, such as pembrolizumab, may interfere with the ability of tumor cells to grow and spread. Vorinostat may stop the growth of tumor cells by blocking some of the enzymes needed for cell growth. Giving pembrolizumab together with vorinostat may be a better treatment for head and neck cancer or salivary gland cancer.

OUTLINE:

Patients receive vorinostat orally (PO) once daily (QD) or via percutaneous endoscopic gastrostomy (PEG) on days 1-5 and pembrolizumab intravenously (IV) over 30 minutes on day 1. Courses repeat every 21 days for up to 2 years in the absence of disease progression or unacceptable toxicity.

After completion of study treatment, patients are followed up at 30 days and every 8-12 weeks thereafter.

Eligibility Criteria:
Inclusion Criteria:

* Phase I run in: biopsy proven RMHNSCC with the following primary sites: nasopharynx, paranasal sinus, nasal cavity, skin/cutaneous sites; patients with unknown head and neck primary sites will be enrolled; patients with recurrent or metastatic squamous cell carcinomas of the head and neck (regardless of primary site) who are either unwilling to receive or have contraindications (deemed by treating physician) to standard systemic chemotherapy will also be eligible; patients with biopsy proven RMSGC be eligible as well
* Phase II expansion: biopsy proven RMHNSCC, of any primary site (including unknown primary) and RMSGC will be eligible
* Have evidence of disease progression by Response Evaluation Criteria in Solid Tumors (RECIST) 1.1 criteria within 3 months prior to study enrollment; if the patient was receiving a prior line of systemic therapy, he/she should have evidence of disease progression on that line of treatment prior to enrollment
* Have received any number lines of prior systemic therapy (including systemic therapy in the curative intent setting)
* Be willing and able to provide written informed consent for the trial and comply with the study visit requirements
* Have measurable disease based on RECIST 1.1
* Have provided tissue from an archival tissue sample or newly obtained core or excisional biopsy of a tumor lesion
* Have a performance status of 0 or 1 on the Eastern Cooperative Oncology Group (ECOG) performance scale
* Absolute neutrophil count (ANC) \>= 1,500/mcL
* Platelets \>= 100,000/mcL
* Hemoglobin \>= 9 g/dL or \>= 5.6 mmol/L
* Serum creatinine =\< 1.5 x upper limit of normal (ULN) OR measured or calculated\* creatinine clearance \>= 60 mL/min for subject with creatinine levels \> 1.5 x institutional ULN (glomerular filtration rate \[GFR\] can also be used in place of creatinine or creatinine clearance \[CrC\])

  * Creatinine clearance should be calculated per institutional standard
* Serum total bilirubin =\< 1.5 x ULN
* Aspartate aminotransferase (AST) (glutamic oxaloacetic transaminase \[SGOT\]) and alanine aminotransferase (ALT) (glutamate pyruvate transaminase \[SGPT\]) =\< 1.5 x ULN
* International normalized ratio (INR) or prothrombin time (PT) =\< 1.5 x ULN unless subject is receiving anticoagulant therapy as long as PT or partial thromboplastin time (PTT) is within therapeutic range of intended use of anticoagulants
* Activated partial thromboplastin time (aPTT) =\< 1.5 x ULN unless subject is receiving anticoagulant therapy as long as PT or PTT is within therapeutic range of intended use of anticoagulants
* Female subjects of childbearing potential should have a negative urine or serum pregnancy within 72 hours prior to receiving the first dose of study medication; if the urine test is positive or cannot be confirmed as negative, a serum pregnancy test will be required
* Female subjects of childbearing potential should be willing to use 2 methods of birth control or be surgically sterile, or abstain from heterosexual activity for the course of the study through 120 days after the last dose of study medication; subjects of childbearing potential are those who have not been surgically sterilized or have not been free from menses for \> 1 year
* Male subjects should agree to use an adequate method of contraception starting with the first dose of study therapy through 120 days after the last dose of study therapy
* Patient is \< 5 years free of another primary malignancy, except: a) if the other malignancy is basal cell carcinoma or cervical carcinoma in situ or b) if the other primary malignancy is not considered clinically significant and is requiring no active intervention
* SECOND COURSE PHASE (RETREATMENT PERIOD FOR POST-COMPLETE RESPONSE RELAPSE ONLY)
* Subjects may be eligible to receive MK-3475 in the second course phase of this study if the study remains open and the subject meets the following conditions:
* Stopped initial treatment with MK-3475 after attaining an investigator-determined confirmed response according to RECIST1.1 response criteria
* Was treated for at least 24 weeks with MK-3475 before discontinuing therapy
* Received at least four treatments with MK-3475 beyond the date when the initial complete response (CR) was declared
* Experienced an investigator-determined confirmed cutaneous or radiographic disease progression after stopping their initial treatment with MK-3475
* Did not receive any anti-cancer treatment since the last dose of MK-3475
* Have a performance status of 0 or 1 on the ECOG performance scale
* Demonstrate adequate organ function as detailed above
* Female subject of childbearing potential should have a negative urine or serum pregnancy test within 72 hours prior to receiving retreatment with study medication
* Female subjects of childbearing potential should be willing to use 2 methods of birth control or be surgically sterile, or abstain from heterosexual activity for the course of the study through 120 days after the last dose of study medication; subjects of child bearing potential are those who have not been surgically sterilized or have not been free from menses for \> 2 year; male subjects should agree to use an adequate method of contraception starting with the first dose of study therapy through 120 days after the last dose of study therapy
* Does not have a history or current evidence of any condition, therapy, or laboratory abnormality that might interfere with the subject's participation for the full duration of the trial or is not in the best interest of the subject to participate, in the opinion of the treating investigator

Exclusion Criteria:

* Is currently participating in or has participated in a study of an investigational agent or using an investigational device within 4 weeks of the first dose of treatment
* Has a diagnosis of immunodeficiency or is receiving systemic steroid therapy or any other form of immunosuppressive therapy within 7 days prior to the first dose of trial treatment
* Has had a prior monoclonal antibody within 4 weeks prior to study day 1 or who has not recovered (i.e., =\< grade 1 or at baseline) from adverse events due to agents administered more than 4 weeks earlier
* Has had prior chemotherapy, targeted small molecule therapy, or radiation therapy within 2 weeks prior to study day 1 or who has not recovered (i.e., =\< grade 1 or at baseline) from adverse events due to a previously administered agent

  * Note: subjects with =\< grade 2 neuropathy are an exception to this criterion and may qualify for the study
  * Note: if subject received major surgery, they must have recovered adequately from the toxicity and/or complications from the intervention prior to starting therapy
* Has a known additional malignancy that is progressing or requires active treatment; 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
* Has known active central nervous system (CNS) metastases and/or carcinomatous meningitis; subjects with previously treated brain metastases may participate provided they are stable (without evidence of progression by imaging for at least four weeks prior to the first dose of trial treatment and any neurologic symptoms have returned to baseline), have no evidence of new or enlarging brain metastases, and are not using steroids for at least 7 days prior to trial treatment
* Has an active autoimmune disease requiring systemic treatment within the past 3 months or a documented history of clinically severe autoimmune disease, or a syndrome that requires systemic steroids or immunosuppressive agents; subjects with vitiligo or resolved childhood asthma/atopy would be an exception to this rule; subjects that require intermittent use of bronchodilators or local steroid injections would not be excluded from the study; subjects with hypothyroidism stable on hormone replacement or Sjogren's syndrome will not be excluded from the study
* Has evidence of interstitial lung disease or active, non-infectious pneumonitis
* Has an active infection requiring systemic therapy
* Has a history or current evidence of any condition, therapy, or laboratory abnormality that might confound the results of the trial, interfere with the subject's participation for the full duration of the trial, or is not in the best interest of the subject to participate, in the opinion of the treating investigator
* Has known psychiatric or substance abuse disorders that would interfere with cooperation with the requirements of the trial
* Is pregnant or breastfeeding, or expecting to conceive or father children within the projected duration of the trial, starting with the pre-screening or screening visit through 120 days after the last dose of trial treatment
* Has received prior therapy with an anti-programmed cell death 1 (PD-1), PD-L1, anti-programmed cell death ligand 2 (PD-L2), anti-cluster of differentiation (CD)137, or anti-cytotoxic T-lymphocyte-associated antigen-4 (CTLA-4) antibody (including ipilimumab or any other antibody or drug specifically targeting T-cell co-stimulation or checkpoint pathways); patients who have previously received MK-3475 or participated in an MK-3475 clinical trial will be ineligible
* Has received prior therapy with vorinostat or other epigenetic agent
* Has a known history of human immunodeficiency virus (HIV) (HIV 1/2 antibodies)
* Has known active hepatitis B (e.g., hepatitis B virus surface antigen \[HBsAg\] reactive) or hepatitis C (HCV) (e.g., HCV RNA \[ribonucleic acid\] qualitative is detected)
* Has received a live vaccine within 30 days prior to the first dose of trial treatment
* Requires total parenteral nutrition and is unable to swallow pills or unable to take a suspension through a gastrostomy tube