The inhibition mechanism of the main protease (Mpro) of SARS-CoV-2 by ebselen (EBS) and its analog with a hydroxyl group at position 2 of the benzisoselenazol-3(2H)-one ring (EBS-OH) was studied by using a density functional level of theory. Preliminary molecular dynamics simulations on the apo form of Mpro were performed taking into account both the hydrogen donor and acceptor natures of the Nδ and Nε of His41, a member of the catalytic dyad. The potential energy surfaces for the formation of the Se–S covalent bond mediated by EBS and EBS-OH on Mpro are discussed in detail. The EBS-OH shows a distinctive behavior with respect to EBS in the formation of the noncovalent complex. Due to the presence of canonical H-bonds and noncanonical ones involving less electronegative atoms, such as sulfur and selenium, the influence on the energy barriers and reaction energy of the Minnesota hybrid meta-GGA functionals M06, M06-2X and M08HX, and the more recent range-separated hybrid functional wB97X were also considered. The knowledge of the inhibition mechanism of Mpro by the small protease inhibitors EBS or EBS-OH can enlarge the possibilities for designing more potent and selective inhibitor-based drugs to be used in combination with other antiviral therapies.