Must have received prior treatment with a CPI in the locally advanced or metastatic urothelial cancer setting. A CPI is defined as a programmed cell death protein (PD-) or programmed death-ligand (PD-L) inhibitor. Patients who received CPI therapy in the neoadjuvant/adjuvant setting and had recurrent or progressive disease either during therapy or within months of therapy completion are eligible. Fresh tumor tissue available for cellular characterization and programmed cell death protein (PD-L) status. Has a tissue sample adequate for programmed death-ligand (PDL) testing as determined by central laboratory testing prior to study allocation. Patients who were treated with chemotherapy, radiotherapy, immunotherapy or any investigational therapies, if eligible, must have been completed at least weeks or at least half-lives (whichever is shorter, but no less than weeks) before the study drug administration, and all AEs have either returned to baseline or stabilized. Prior therapies targeting PD-, programmed death-ligand (PD-L), or PARP is exclusionary (See Exclusion Criterion ). Prior therapies targeting PD-, programmed death-ligand (PD-L), or PARP. Prior treatment with PD- and programmed death ligand (PD-L) inhibitors Can provide either a newly obtained or archival tumor tissue sample for intra-tumoral immune-related testing and for anti-programmed cell death (PD)- For solid tumors other than melanoma, (in Part or [dose confirmation only]), participants must have a malignancy that is incurable and has either: (a) failed prior standard therapy, (b) for which no standard therapy exists, or (c) standard therapy is not considered appropriate by the participants and treating physician. There is no limit to the number of prior treatment regimens, but prior treatment(s) should not include compounds targeting programmed cell death (PD-), PD- ligand (PD-L), BRAF, or mitogen-activated protein kinase (MEK). Treatment must end at least weeks prior to randomization. Has received prior systemic anti-cancer therapy including investigational agents or has used an investigational device within days prior to the first dose of study treatment. (Notes: Participants must have recovered from all AEs due to previous therapies to ?Grade or baseline. Prior exposure to immunotherapeutics is allowed, including programmed cell death- (PD-) and programmed cell death-ligand (PD-L) inhibitors, provided the participant did not experience ?Grade drug-related toxicity on monotherapy with a PD- or PD-L inhibitor. Confirmed tumor programmed death?ligand (PD-L) evaluation as documented through central testing of a representative tumor tissue specimen One prior disease progression episode on or after vascular endothelial growth factor (VEGF)-targeted treatment (for example, but not limited to, sunitinib, sorafenib, pazopanib, cabozantinib, bevacizumab, axitinib, vatalanib, AV/tivozanib) administered for the treatment of RCC. Prior programmed cell death protein (PD-)/programmed death-ligand (PD-L) treatment in addition to prior VEGF-targeted treatment is allowed. Previous treatment with atezolizumab or another programmed death- (PD-)/PD-L inhibitor Treatment with an investigational agent within weeks of starting study treatment or prior treatment with a checkpoint inhibitor (cytotoxic T-lymphocyte-associated protein (CTLA-), programmed cell death protein (PD-) or programmed death ligand (PD-L) antibodies). Tumor tissue that demonstrates programmed cell death ligand (PD-L) expression in ? % of tumor cells (tumor proportion score [TPS] ? %) as assessed by immunohistochemistry at a central laboratory. Programmed death ligand (PD-L) expression on ? % of tumor cells by validated immunohistochemistry assay Any previous treatment with a programmed cell death protein (PD) or programmed cell death ligand (PD-L) inhibitor, including durvalumab Patients who have previously received prior pembrolizumab or programmed cell death ligand (PD-/L) blockade therapy; adjuvant interferon alpha (IFN-a), is allowed if last dose was received at least months of starting study treatment Any number of previous treatments with the exception of previous inhibitors of programmed cell death (PD-), PD-L, or programmed cell death ligand (PD-L); other prior systemic therapies must have been administered at least weeks before administration of pembrolizumab; the exception to this is ipilimumab which must have been administered at least weeks prior to the start of pembrolizumab; patients are not required to have had prior systemic therapy Prior treatment with immune therapy (including but not limited to cluster of differentiation [CD], OX, programmed cell death [PD]-, PD-L or cytotoxic T-lymphocyte antigen [CTLA] inhibitors) Has experienced a dose limiting toxicity on treatment with either prior radiation or anti programmed cell death (PD-) or programmed cell death ligand (PD-L) inhibitor therapy Any number of previous treatments with the exception of previous inhibitors of programmed cell death (PD-), PD-L, or programmed cell death ligand (PD-L); other prior systemic therapies must have been administered at least weeks before administration of MK- with the exception of bevacizumab which must have been administered at least weeks prior to MK-; patients are not required to have had prior systemic therapy; the exception to this is patients with NSCLC who test negative for PD-L expression or are unevaluable for PD-L expression must have received prior platinum-based chemotherapy for entry into cohort \r\n* Note: ipilimumab treatment should have been administered at least weeks prior to the start of MK- Part b: Must have documented confirmed disease progression on a prior programmed cell death- (PD-) pathway targeted agent or must be PD- pathway-targeted treatment nave. Received or ineligible for platinum-based therapy and Programmed death receptor- (PD-)/programmed death-ligand (PD-L) therapy Prior exposure to any agent (approved or investigational) that blocks the programmed cell death- (PD-)/PD-L pathway. Any number of prior therapies (including none). For subjects who have received prior systemic treatment with cytotoxic T-lymphocyte-associated protein (CTLA-), Programmed death (PD-) and/or Programmed death-ligand (PD-L) therapy, the last monoclonal antibody administration should be no less than weeks prior to start of this protocol therapy and all prior side effects must have resolved to grade or less by the time of the start of this protocol therapy. Previous treatment with a programmed death (PD), programmed death-ligand (PD-L), or cytotoxicT-lymphocyte-associated protein (CTLA-) inhibitors, or any form of immunotherapy for HCC. Availability of a representative tumor specimen from a site not previously irradiated that is suitable for determination of programmed death-ligand (PD-L) status via central testing For melanoma patients, patients must have received prior programmed cell death protein (PD-) therapy and have progressed immune-related progressive disease (irPD) by immune-related Response Criteria (irRC) Prior treatment with immune-modulatory agents including, but not limited to: interleukin (IL)-, cytotoxic T-lymphocyte antigen (CTLA)- blockade, programmed death (PD-)-/programmed death-ligand (PD-L) blockade, cluster of differentiation (CD) stimulation, CD stimulation with the exception of INF-alpha given as adjuvant treatment for high-risk, surgically resected melanoma Patients with previous exposure to anti-programmed cell death (PD)- or anti-programmed cell death ligand (PDL-) will not be eligible Patients who have previously received ipilimumab, programmed cell death (PD-) inhibitors or programmed cell death-ligand (PD-L) inhibitors are excluded Subjects who received prior adjuvant therapy for melanoma will not be excluded (including, but not limited to, interferon, ipilimumab, limb infusion/perfusion, or use of investigational agents in the adjuvant setting) with the exception that prior adjuvant therapy with inhibitors of programmed cell death (PD-) or programmed cell death ligand (PD-L) is not allowed. However, if the subject received adjuvant therapy, the subject must have completed therapy at least days prior to enrollment. Tumor sample must be available for analysis of PDL (Programmed death-ligand ) and HPV [Human Papilloma Virus (oropharynx only)] HER/neu protein negative and programmed cell death ligand (PD-L)-positive Prior treatment with an agent that blocks the programmed death-/ programmed death-ligand (PD-/PD-L pathway) (certain exceptions may apply) Subjects must not have received immunotherapy with programmed death receptor- (PD-) or cytotoxic T-lymphocyte antigen (CTLA-) targeted therapy. Central determination of programmed cell death ligand (PD-L) tumor status Availability of a representative tumor specimen that is suitable for determination of programmed death-ligand (PD-L) and/or additional biomarker status via central testing Able to submit tumor tissue that is evaluable for programmed death- ligand (PD-L) expression Prior anti- Cytotoxic T-lymphocyte-associated antigen (CTLA-), Programmed death- (PD-), or Programmed death ligand- (PD-L) or other immune checkpoint mAb exposure. Tumor tissue available for programmed cell death ligand (PD-L) testing Receipt of prior immunomodulatory agents, including programmed death- or PD-L targeted therapy or cytotoxic T-lymphocyte-associated antigen targeted therapy including ipilimumab (this exclusion criterion does not apply to participants enrolled in Expansion Cohort A) Participants with any programmed death-ligand (PD-L) test result by immunohistochemistry (IHC) are eligible for the study Per good clinical practice, any toxicity related to prior therapies that, in the opinion of the investigator, would potentially be worsened with anti-programmed death (PD) therapy should be resolved to less than grade Subjects who have had chemotherapy or radiotherapy or any systemic therapy for melanoma within weeks prior to entering the study or those who have not recovered from adverse events due to agents administered more than weeks earlier; no concomitant therapy is allowed including interleukin- (IL), interferon, ipilimumab, anti-programmed cell death (PD-) or anti-programmed death-ligand (PD-L) antibody, cytotoxic chemotherapy, immunosuppressive agents, or other investigational therapies Must provide a tumor sample (archival or newly obtained biopsy) that is adequate for determination of PD (programmed cell death)-Ligand status by immunohistochemistry at a central pathology laboratory prior to enrollment. Note: Adequacy of the tumor sample for PD-Ligand testing is not required prior to enrollment in Part C Subject whom participated in either arm of the following clinical trials CA-, CA-, CA-, and CA- or received prior treatment with anti-programmed death (PD-) or anti-programmed death-ligand (PDL) experimental agents Histologically- or cytologically-confirmed diagnosis of NSCLC that is anti-programmed cell death ligand (PD-L) positive per central laboratory review Systemic cancer therapy (standard or experimental), including cytotoxic chemotherapy or IL-, received less than weeks or checkpoint blocking agents (e.g., cytotoxic T-lymphocyte protein [CTLA]- or programmed cell death protein [PD]/PD-ligand [L] inhibitors) received less than weeks prior to lymphodepletion, with the exception of targeted therapies Tumor cell programmed death-ligand (PD-L) score of tumor cells (TC)- and immune cell PD-L score of tumor-infiltrating immune cells (IC)- as determined by an immunohistochemistry (IHC) assay performed by the central laboratory on tissue obtained after the last line of therapy Has received any previous systemic therapy targeting programmed death (PD) or PD-ligand / signaling pathways, and other immune checkpoint inhibitors Received any prior monoclonal antibody against cytotoxic T-lymphocyte antigen (CTLA-), programmed cell death (PD) or programmed cell death ligand (PD-L) Can provide either a newly obtained or archival tumor tissue sample for intratumoral immune-related testing and for anti-programmed cell death (PD-) Any prior or concurrent investigational or standard therapy for treatment of metastatic NSCLC including radiation therapy, chemotherapy, biological therapy (with the exception of tyrosine kinase inhibitor as a single agent, which must be at least half-lives prior to day , and/or immunotherapy, such as a programmed cell death [PD-] or programmed cell death ligand [PD-L] inhibitor, which the last dose must have been given at least weeks prior to day ) or hormonal therapy; (palliative-targeted radiotherapy for brain or bone metastases is permitted providing it has been at least days prior to day ) Tissue or Programmed death-ligand (PD-L) results available Cohort A Inclusion Criteria: Available tumor sample for Programmed death-ligand (PD-L) immunohistochemical (IHC) and exon TM testing Any previous treatment with a programmed cell death protein (PD) or programmed cell death- ligand (PD-L) inhibitor, including durvalumab Patients may have received up to two prior therapies including vascular endothelial growth factor (VEGF), mammalian target of rapamycin (mTOR) and programmed cell death (PD)-/PD ligand (L) inhibitors; prior palliative radiation to metastatic lesion(s) is permitted, provided there is at least one measurable and/or evaluable lesion(s) that has not been irradiated Subjects may have failed a programmed cell death protein (PD-) or programmed death-ligand (PD-L) therapy for advanced disease. For Phase I: For treatment-experienced patients, the following washout periods are required prior to enrollment on the study: weeks wash out after prior local therapy (such as radiation therapy or intra-lesional therapy), weeks wash out after cytotoxic therapy or high dose interleukin-, and weeks wash out after anti-programmed cell death (PD-) or anti-programmed cell death ligand (PD-L) therapy; for all other therapy not mentioned, a wash out period of at least half-lives will be needed A history of prior treatment with ipilimumab, nivolumab or other cytotoxic t-lymphocyte-associated protein (CTLA-), programmed cell death (PD) or PD-L inhibitor Tumor programmed death-ligand (PD-L) expression, as determined by immunohistochemistry (IHC) assay of archival tumor tissue or tissue obtained at screening Prior therapy with a Cytotoxic T Lymphocyte Antigen (CTLA-) or Programmed death- \n (PD-) antagonist, or Programmed cell death- ligand (PD-L) or CD agonists Prior treatment with a CD agonist, ipilimumab, or the cytotoxic T-lymphocyte antigen (CTLA-) inhibitor, or programmed death- (PD-)/programmed cell death ligand (PDL-) inhibitor Backfill cohort enrollment may be limited to participants whose tumors have PD-L (programmed death-ligand ) and/or different levels of cluster of differentiation (CD) expression, as defined by the Sponsor Documentation of program death ligand- (PD-L) status prior to randomization. Subjects must have programmed death-ligand (PD -L) immunohistochemical (IHC) testing, with results, performed by the central lab during the Screening period