Inclusion Criteria:
* Participant must be more than or equal to (\>=)18 years of age.
* Participants with advanced/recurrent solid tumors, who have progressed on, be intolerant of, or ineligible for, all available therapies for which clinical benefit has been established.
* Histological or cytological documentation of an advanced solid tumor.
* Participants must provide a fresh biopsy.
* Measurable disease per Response Evaluation Criteria in Solid Tumors (RECIST) version 1.1.
* Eastern Cooperative Oncology Group (ECOG) performance status (PS) 0-1.
* Adequate organ function per protocol specifications.
* Male or female participants.
* Female participants are eligible to participate if they are not breastfeeding or pregnant (or intend to breastfeed or become pregnant). Women of childbearing potential must use a highly effective method of contraception.
* Capable of giving signed informed consent.
Exclusion Criteria:
* Active autoimmune disease that has required systemic disease modifying or immunosuppressive treatment within the last 2 years.
* Concurrent medical condition requiring the use of systemic immunosuppressive treatment within 28 days before the first dose of study treatment.
* Current unstable liver or biliary disease.
* History of vasculitis at any time prior to study treatment.
* Evidence or history of significant active bleeding or coagulation disorder.
* Active infection requiring systemic treatment, known human immunodeficiency virus infection, or positive test for hepatitis B surface antigen or hepatitis C.
* QT duration corrected for heart rate by Fridericia's formula (QTcF) more than (\>)450 milliseconds (msec) or QTcF \>480 msec for participants with bundle branch block.
* Recent history (within the past 6 months) of acute diverticulitis, inflammatory bowel disease, intra-abdominal abscess, or gastrointestinal obstruction.
* Recent history of allergen desensitization therapy within 4 weeks of starting study treatment.
* History or evidence of cardiovascular (CV) risk
* Recent (within the past 6 months) history of symptomatic pericarditis.
* History of idiopathic pulmonary fibrosis, interstitial lung disease, or organizing pneumonia, or evidence of active, non-infectious pneumonitis.
* History of (non-infectious) pneumonitis that required steroids or current pneumonitis.
* Recent history (within 6 months) of uncontrolled symptomatic ascites or pleural effusions.
* Prior treatment with the following agents:
1. Stimulator of Interferon Genes (STING) agonist at any time.
2. Anticancer therapy or investigational therapy or used an investigational device within 28 days or 5 half-lives of the drug, whichever is shorter.
3. Checkpoint inhibitors, including Programmed death receptor-1 (PD-1), Programmed death Ligand-1 (PD-L1), PD-L2 and Cytotoxic T-lymphocyte-associated antigen 4 (CTLA-4) inhibitors within 28 days.
4. Prior radiation therapy: permissible if at least 1 non-irradiated measurable lesion is available for assessment according to RECIST version 1.1 or if a solitary measurable lesion was irradiated, objective progression is documented.
* Pregnant and/or breast feeding participants or those who plan to become pregnant and/or breastfeed.
* Receipt of any live vaccine within 30 days of the start of study treatment.
* Prior allogeneic or autologous bone marrow transplantation or other solid organ transplantation.
* Major surgery less than or equal to (\<=)28 days before the first dose of study treatment. Participants must have also fully recovered from any surgery (major or minor) and/or its complications before initiating study treatment.
* Participants with signs/symptoms suggestive of Coronavirus Disease-2019 (COVID-19) within 14 days of study entry, or with known exposure to COVID-19 within 14 days prior to study entry.
* Participants are excluded from Part 2A of the study if they have known hypersensitivity to dostarlimab or associated excipients.