You are thinking that one molecule of methanol is reacting with one molecule of the substrate. Is that it?
Methanol is an important organic solvent because it dissolves many organic compounds. In particular, for this reaction methanol is a good solvent because it'll dissolve the allylic halide very well.
Now, methanol is a solvent for this reaction. What this means is, the alkyl halide ( some millions of alkyl halide molecules ) is dissolved in a huge excess of methanol. Now, a solvent could become a reactant too, if a reaction is possible. Why shouldn't it? If a reaction is possible and if the reactants come in contact, the reaction should happen. A carbocation will be formed after loss of bromine. The carbocation would normally be solvated by suitable solvent molecules. But in this case, a reaction between the two is possible- the carbocation is an electrophile and methanol is a nucleophile - so a HOMO-LUMO electron transfer sounds reasonable.
Thus a solvent can both dissolve an organic compound- and if a reaction is possible it could react with it as well. This is technically called " Solvolysis "