This phase II trial studies the effect of pembrolizumab, dabrafenib, and trametinib before surgery in treating patients with BRAF V600E-mutated anaplastic thyroid cancer. The gene discussed is BRAF; the disease is thyroid gland undifferentiated (anaplastic) carcinoma.