A search is presented for dark matter in proton-proton collisions at a center-of-mass energy of $\sqrt{s}=$ 13 TeV using events with at least one high transverse momentum ($p_\mathrm{T}$) muon, at least one high-$p_\mathrm{T}$ jet, and large missing transverse momentum. The data were collected with the CMS detector at the CERN LHC in 2016 and 2017, and correspond to an integrated luminosity of 77.4 fb$^{-1}$. In the examined scenario, a pair of scalar leptoquarks is assumed to be produced. One leptoquark decays to a muon and a jet while the other decays to dark matter and low-$p_\mathrm{T}$ standard model particles. The signature for signal events would be significant missing transverse momentum from the dark matter in conjunction with a peak at the leptoquark mass in the invariant mass distribution of the highest $p_\mathrm{T}$ muon and jet. The data are observed to be consistent with the background predicted by the standard model. For a first benchmark scenario, dark matter masses up to 430 GeV are excluded for leptoquark masses $M_\mathrm{LQ}\approx$ 1000 GeV, and up to 300 GeV for $M_\mathrm{LQ}\approx$ 1170 GeV. For a second benchmark scenario, dark matter masses up to around 480 GeV are excluded for $M_\mathrm{LQ}\approx$ 1100 GeV.