If your plan is to use company A's dispenser as-is, then you clearly can't get any apparatus claims.
You might be able to write a patent with only method claims, on the order of:
A method of dispensing [product B], consisting of the following steps:
[ Steps to use dispenser A].
Unless you can show substantial differences between product B, and whatever is normally dispensed from product A, chances are that this isn't going to get very far though.
For example, if product A is normally used to dispense liquids within some fairly specific viscosity range, and product B isn't a liquid at all, but the specific combination of A and B works well because of some way they interact that wouldn't have been obvious or predictable, then you might stand a chance of getting a patent.
If, however, product B has a different purpose, but from a viewpoint of dispensing is substantially similar to whatever product A normally dispenses, then you probably don't have any basis for a patent (e.g., noticing that gravy and shampoo are both thick liquids, so the same type of dispenser works for either one probably won't qualify as a basis for a patent).
Even if you can get a patent, it would only cover actual use of dispenser A to dispense product B. If somebody else tries to go into the market selling dispenser A pre-filled with product B, you might stand a good chance of enforcing the patent against them. If the two simply continue to be sold separately, essentially your only route to accuse either of infringement would be proving that the company was aware of your patent covering the combination, and specifically encouraged customers to use the combination anyway (i.e., nearly impossible to prove unless you can find some letter/memo/email directly admitting guilt.
Summary (to quote the magic 8-ball): "Outlook not so good".