You can think of bag of words (BoW) model as a generative model that generates visual words by drawing i.i.d. samples from a multinomial distribution.
Generative interpretation of BoW models
Consider a (visual) vocabulary of size $K$. Let $v = \{v_1, \dots, v_K\}$ denote the categorical distribution defined over these $K$ possible outcomes so that $v_k$ denotes the probability that a sample from the bag is from the $k$-th visual word. The probability that we observe $b_k$ elements from the $k$-th word in a bag of size $|b| = \sum_{k=1}^K b_k$ is computed from a multinomial distribution with parameters $v$ as follows:
$$
p(b \mid v) = \frac{|b|!}{b_1! \times b_2! \times \dots \times b_K!}\prod_{k=1}^K v_k^{b_k} \tag{1}
$$
Training BoWs using MLE vs. regularized log linear models
Note that $\log\left( p(b \mid v) \right) = \sum_{k=1}^K b_k \log(v_k) = w \cdot b$ where $w = \log(v)$, and finding the maximum likelihood estimate of the parameters $v$ on a set of $n$ training bags $B = \{b^{(1)}, b^{(2)}, \dots, b^{(n)}\}$ is equivalent to training a regularized BoW model $w$ on $B$:
$$
\begin{align}
v^* &= \arg\max_v p(B | v) \\
&= \arg\max_v \sum_{i=1}^n \log\left( p(b^{(i)} \mid v) \right) \\
&= \arg\max_v \sum_{i=1}^n \log(v) \cdot b^{(i)} \tag{2} \\
w^* &= \arg\max_w \sum_{i=1}^n w \cdot b^{(i)} - \lambda ||w||^2 \tag{3}
\end{align}
$$
where $\lambda$ in $(3)$ is a hyperparameter that should be tuned to make $\sum_{k=1}^K e^{w_k} = 1$, thereby, making $v_1 = e^{w_1}, \dots, v_k = e^{w_K}$ a probability distribution.
References
For more details, see Section 3.1 in Reconfigurable Models for Scene Recognition, CVPR 2012.