Inclusion Criteria:  Participant must have histological or cytological proven diagnosis of advanced (stage IV) NSCLC without known EGFR-sensitizing mutation or ALK/ROS1 rearrangements and/or histological or cytological proven diagnosis of advanced or metastatic MPM (according to the 8th Edition of the UICC TNM Classification). Participant must have experienced disease progression or recurrence during or after at least one systemic therapy for advanced metastatic disease: Participant must be able to provide adequate archival tumor tissue specimen for central somatic (s)HRd and PD-L1 status assessment, which may have been collected at any time prior to screening. If no archival FFPE tumor tissue is available, a newly obtained tissue biopsy is required before Cycle 1/Day 1. Participant must be able to provide adequate pre-treatment blood samples for central germline (g)HRd assessment. Participant must have centrally-confirmed positivity for germline or somatic HRd status and tumor PD-L1 expression (TPS ≥ 1%). Participant with NSCLC must have measurable disease by computed tomography (CT) scan as defined by RECIST v1.1: at least 1 tumor lesion ≥10 mm in the longest diameter, or a lymph node ≥15 mm in short axis measurement. Participant with MPM must have Evaluable disease or measurable disease as assessed according to the mRECIST v1.1 Participant must have an Eastern Cooperative Oncology Group (ECOG) performance status of ≤1 Participant must be ≥ 18 years of age Participant must have adequate organ function Female participant has a negative urine or serum pregnancy test within 24-72 hours prior to taking study treatment if of childbearing potential and agrees to abstain from activities that could result in pregnancy and to perform a monthly pregnancy testing from screening through 180 days after the last dose of study treatment, or is of nonchildbearing potential. Participant must agree to not breastfeed during the study or for 150 days after the last dose of study treatment. Male participant agrees to use an adequate method of contraception (see Section 4.4 for a list of acceptable birth control methods) starting with the first dose of study treatment through 180 days after the last dose of study treatment. Note: Abstinence is acceptable if this is the established and preferred contraception for the patient. Participant must be able to understand the study procedures and agree to participate in the study by providing written informed consent  Exclusion Criteria:  Participant with current participation in any interventional clinical trial and/or Participant who received investigational therapy ≤ 4 weeks, or within a time interval less than at least 5 half-lives of the investigational agent, whichever is shorter, prior initiating protocol therapy. Participant who received major surgery ≤3 weeks prior to initiating protocol therapy and/or has been recovered from any surgical effects. Participant who received last treatment ≥12 weeks from initiation of protocol therapy. Participant who received radiation therapy within 2 weeks prior to Day 1 of protocol therapy. Participant with known hypersensitivity to niraparib and dostarlimab components or excipients. Participant who received transfusion (platelets or red blood cells) ≤4 weeks prior to initiating protocol therapy. Participant who received colony stimulating factors (eg, granulocyte colony-stimulating factor, granulocyte macrophage colony stimulating factor, or recombinant erythropoietin) within 4 weeks prior initiating protocol therapy. Participant with any known Grade 3 or 4 anemia, neutropenia or thrombocytopenia due to prior chemotherapy that persisted > 4 weeks and was related to the most recent treatment. Participant with any known history of myelodysplastic syndrome (MDS) or acute myeloid leukemia (AML) Participant with a serious, uncontrolled medical disorder, nonmalignant systemic disease, or active, uncontrolled infection. Examples include, but are not limited to, uncontrolled ventricular arrhythmia, recent (within 90 days) myocardial infarction, uncontrolled major seizure disorder, unstable spinal cord compression, superior vena cava syndrome, or any psychiatric disorder that prohibits obtaining informed consent Participant with diagnosis, detection, or treatment of another type of malignancy ≤2 years prior to initiating protocol therapy (except basal or squamous cell carcinoma of the skin and cervical cancer that has been definitively treated) Participant with known, symptomatic brain or leptomeningeal metastases. Patient who experienced ≥ Grade 3 immune-related AE with prior immunotherapy, with the exception of non-clinically significant lab abnormalities. Participant with a diagnosis of immunodeficiency or is receiving chronic systemic steroid therapy (exceeding 10 mg of prednisone or equivalent daily) or any other form of immunosuppressive therapy within 7 days prior to initiating protocol therapy. Participant with a known history of human immunodeficiency virus (type 1 or 2 antibodies). Participant with a known active hepatitis B (e.g., hepatitis B surface antigen [HBsAg] reactive) or hepatitis C (e.g., hepatitis C virus [HCV] ribonucleic acid [qualitative] is detected). Participant with an active autoimmune disease that has required systemic treatment in the past 2 years (ie, with use of disease-modifying agents, corticosteroids, or immunosuppressive drugs). Replacement therapy (eg, thyroxine, insulin, or physiologic corticosteroid replacement therapy for adrenal or pituitary insufficiency, etc.) is not considered a form of systemic treatment. Participant with a known history of interstitial lung disease, drug-related pneumonitis, or radiation pneumonitis requiring steroid treatment Participant has received a live vaccine within 14 days of initiating protocol therapy. Participant who received prior treatment with a PARP inhibitor Participant who is pregnant, breastfeeding, or expecting to conceive children while receiving study treatment and for 180 days after the last dose of study treatment Male participant who is expecting to donate sperm or father children while receiving study drug or for 180 days after the last dose of study treatment