Inclusion Criteria:
* Phase I: Adult subjects with advanced MDS requiring therapy who were previously treated with either azacitidine or decitabine for at least 4 cycles and deemed to have failed therapy due to progression of disease using International Working Group (IWG) criteria ("refractory") or losing their previously documented response to the therapy ("relapsed")
* Phase II: Adult subjects with advanced MDS requiring therapy who were previously treated with either azacitidine or decitabine for at least 4 cycles and deemed to have failed therapy due to progression of disease using IWG criteria ("refractory") or losing their previously documented response to the therapy ("relapsed")
* MDS should be classified as:
* Intermediate 1-risk or higher risk according to the international prognostic scoring system (IPSS) or revised IPSS
* Chronic myelomonocytic leukemia (CMML)
* During the 8 weeks prior to inclusion in study, subjects must have a baseline bone marrow examination including all of the following:
* Cytomorphology to confirm bone marrow blasts;
* Cytogenetics; AND
* Eastern Cooperative Oncology Group (ECOG) status 0-2
* Subject is able to understand and willing to comply with protocol requirements and instructions
* Subject has signed and dated informed consent
* Total bilirubin (except for Gilbert's syndrome) =\< 2.5 x upper limit of normal (ULN)
* Aspartate aminotransferase (ALT) and alanine aminotransferase (AST) =\< 3 x ULN
* Creatinine =\< 2.5 x ULN
* For women of childbearing potential: agreement to remain abstinent (refrain from heterosexual intercourse) or use contraceptive methods that result in a failure rate of \< 1% per year during the treatment period and for at least 90 days after the last dose of atezolizumab
* A woman is considered to be of childbearing potential if she is postmenarcheal, has not reached a postmenopausal state (\>= 12 continuous months of amenorrhea with no identified cause other than menopause), and has not undergone surgical sterilization (removal of ovaries and/or uterus)
* Examples of contraceptive methods with a failure rate of \< 1% per year include bilateral tubal ligation, male sterilization, proper use of hormonal contraceptives that inhibit ovulation, hormone-releasing intrauterine devices, and copper intrauterine devices
* The reliability of sexual abstinence should be evaluated in relation to the duration of the clinical trial and the preferred and usual lifestyle of the patient; periodic abstinence (e.g., calendar, ovulation, symptothermal, or postovulation methods) and withdrawal are not acceptable methods of contraception
* For men: agreement to remain abstinent (refrain from heterosexual intercourse) or use contraceptive measures, and agreement to refrain from donating sperm, as defined below:
* With female partners of childbearing potential, men must remain abstinent or use a condom plus an additional contraceptive method that together result in a failure rate of \< 1% per year during the treatment period and for at least 120 days after the last dose of guadecitabine; men must refrain from donating sperm during this same period
* With pregnant female partners, men must remain abstinent or use a condom during the treatment period and for at least 30 days after the last dose of guadecitabine to avoid exposing the embryo
* The reliability of sexual abstinence should be evaluated in relation to the duration of the clinical trial and the preferred and usual lifestyle of the patient; periodic abstinence (e.g., calendar, ovulation, symptothermal, or postovulation methods) and withdrawal are not acceptable methods of contraception
* Women of childbearing potential (WOCBP) must have a negative serum test (minimum sensitivity 25 IU/L or equivalent units of human chorionic gonadotropin \[HCG\]) within 72 hours prior to the start of investigational product
Exclusion Criteria:
* Any active history of a known autoimmune disease; subjects with vitiligo, type 1 diabetes mellitus, residual hypothyroidism requiring hormone replacement, or conditions not expected to recur in the absence of an external trigger are permitted to enroll
* Subjects with a history of interstitial lung disease; patients requiring continuous supplemental oxygen are excluded to avoid possible complications from pneumonitis
* History of idiopathic pulmonary fibrosis, organizing pneumonitis (e.g., bronchiolitis obliterans), drug-induced pneumonitis, or idiopathic pneumonitis
* Patients who are actively receiving any other anticancer therapy
* Patients with a history of allergic reactions attributed to compounds of similar chemical or biologic composition to HMAs
* Patients with a diagnosis of acute myeloid leukemia (AML) not transformed from MDS or transformed from MDS with \> 30% blasts in bone marrow or white blood cells (WBC) \> 25 x 10\^3/L
* Patients with short life expectancy (less than 3 months) due to comorbidity other than MDS
* Female subjects who are nursing or pregnant (positive serum or urine beta-human chorionic gonadotropin \[B-hCG\] pregnancy test)
* Patients with current alcohol or drug abuse
* Patients who have received treatment with an investigational drug within 30 days preceding the first dose of study medication
* Patients with uncontrolled inter-current illness including, but not limited to, ongoing or active infection, symptomatic congestive heart failure, unstable angina pectoris, uncontrolled cardiac arrhythmia, or psychiatric illness/social situations that would limit compliance with study requirements
* Patients with prior infections must be afebrile for \>= 72 hours and completed any antibiotics prior to receiving study drug
* In patients who received IV antibiotics for active infection, a washout period of 14 days is required prior to initiating study therapy (exception: patients with febrile neutropenia in whom no infectious etiology has been determined/documented)
* Patients receiving chronic antimicrobial prophylaxis therapy (e.g. antifungal prophylaxis) may be included in the study provided there is no active infection
* Patients infected with hepatitis B, C or human immunodeficiency virus (HIV), unless they are on stable and effective antiviral treatment
* Serious infection requiring oral or IV antibiotics/antifungals/antivirals and/or hospitalization within 28 days prior to screening
* Patients on prophylactic oral antibiotics, antifungals and antivirals due to prolonged neutropenia in the absence of documented infection are eligible
* Patients who are treated with IV antibiotics for neutropenic fever, are eligible if no infectious etiology was determined and the last dose of antibiotics was \>= 7 days from cycle 1, day 1
* Patients with a condition requiring systemic treatment with either corticosteroids (\> 10 mg daily prednisone equivalent) or other immunosuppressive medications within 14 days of randomization. Inhaled or topical steroids and adrenal replacement steroid doses \> 10 mg daily prednisone equivalent, are permitted in the absence of uncontrolled autoimmune disease
* Medication-related exclusion criteria
* Prior treatment with anti-PD-1, or anti-PD-L1 therapeutic antibody or pathway-targeting agents
* Prior treatment with anti-cytotoxic T-lymphocyte-associated protein 4 (CTLA-4) therapeutic agents (e.g. ipilimumab)
* Treatment with systemic immunostimulatory agents (including but not limited to interferon \[IFN\]-alpha or interleukin \[IL\]-2) within 6 weeks or five half-lives of the drug (whichever is shorter) prior to cycle 1, day 1
* Treatment with any investigational agent within 4 weeks prior to cycle 1, day 1 (or within five half-lives of the investigational product, whichever is longer)
* Treatment with systemic immunosuppressive medications (including but not limited to prednisone, cyclophosphamide, azathioprine, methotrexate, thalidomide, and anti-tumor necrosis factor \[anti-TNF\] agents) within 2 weeks prior to cycle 1, day 1
* Patients who have received acute, low-dose, systemic immunosuppressant medications may be enrolled
* The use of inhaled corticosteroids and mineralocorticoids (e.g., fludrocortisone) for patients with orthostatic hypotension or adrenocortical insufficiency is allowed
* History of severe allergic, anaphylactic, or other hypersensitivity reactions to chimeric or humanized antibodies or fusion proteins
* Patients with prior allogeneic bone marrow transplantation or prior solid organ transplantation