This phase II trial studies the effect of brentuximab vedotin and nivolumab alone and in combination with rituximab, cyclophosphamide, doxorubicin, and prednisone in treating patients with untreated, stage I-IV primary mediastinal large B-cell lymphoma. Brentuximab vedotin is a monoclonal antibody, called brentuximab, linked to a toxic agent, called vedotin. Brentuximab is a form of targeted therapy because it attaches to specific molecules (receptors) on the surface of cancer cells, known as CD30 receptors, and delivers vedotin to kill them. Immunotherapy with monoclonal antibodies, such as nivolumab, may help the body's immune system attack the cancer, and may interfere with the ability of tumor cells to grow and spread. Rituximab is a type of antibody therapy, which targets and attaches to the CD20 protein found on the surface of blood cells with cancer and some healthy blood cells. Chemotherapy drugs, such as cyclophosphamide, and doxorubicin, work in different ways to stop the growth of cancer cells, either by killing the cells, or by stopping them from dividing. Prednisone is a steroid, a hormone (chemical messengers) with multiple roles, notably in the immune system and inflammation reduction. Steroids are poisonous to lymphocytes (white blood cells from which lymphomas develop). Giving brentuximab vedotin and nivolumab in combination with rituximab, cyclophosphamide, doxorubicin, and prednisone may help to control the disease and be a less harmful regimen than standard chemotherapy in patients with primary mediastinal large B-cell lymphoma.