Edit: This answer is in response to the original form of the question, which was: Under what condition does an category has universal property?
Which category has universal property? Hom(M,N)? $ M\otimes N$? For M,N modules. Does universal property compatible to each other? Under the context of category of module especially. The intention is to help the asker clarify what these words actually mean, since the question displays a clear dearth of understanding.
It is instructive to understand categories of vector spaces (linear algebra) before you attempt to understand categories of modules. So let's assume we are working in the category of vector spaces over a field $F$. That is, we assume $M$ and $N$ are vector spaces over $F$.
The tensor product $M \otimes_F N$ satisfies the following universal property: It comes equipped with a bilinear function $$\varphi: M \times N \to M \otimes_F N$$ given by $$(m, n) \mapsto m \otimes n,$$ and for any bilinear function $$f: M \times N \to V,$$ for some other vector space $V$, there exists a unique linear transformation $$\tilde{f}: M \otimes_F N \to V$$ with the property that $\tilde f \circ \varphi = f$.
Note that bilinear maps are not morphisms in this category - this universal property cannot be expressed within the language of the category of vector spaces. If you haven't seen it before:
Definition: a function $f: M \times N \to V$ is bilinear if for every $a, b, c, d \in F$ and $m, m' \in M$, $n, n' \in N$, we have $f(am+bm', cn+dn') = acf(m, n) + adf(m, n') + bcf(m', n) + bdf(m', n')$. That is to say, $f$ is linear in $M$ and linear in $N$.
Now $Hom_F(M, N)$ is just the set of morphisms in the category. It happens to also have the structure of an $F$-vector space: for $f, g: M \to N$ a linear transformation and $a, b \in F$ scalars, we have $(af+bg): M \to N$ defined by $(af+bg)(m) = a(f(m))+b(g(m))$.
Finally, $M^*$ is defined as $Hom_F(M, F)$.
Those are the tools required to define a canonical homomorphism $$\Phi: M^* \otimes_F N \to Hom_F(M, N),$$ namely by $$(f, n) \mapsto \{m \mapsto f(m)n\},$$ where $\Phi$ can be shown to be a well-defined linear transformation using the universal property of tensor products (that is, the formula given for $\Phi(f, n)$ is linear in both $f$ and $n$).
For example, if $M$ has a basis $\{m_1, \ldots, m_k\}$ and $N$ has a basis $\{n_1, \ldots, n_\ell\}$, then we can denote by $m_i^*$ the dual basis: For $i = 1, 2, \ldots, k$, we define $m_i^* \in Hom_F(M, F)$ by $m_i^*(m_j) =1$ if $i =j$ and $m_i^*(m_j) = 0$ if $i \neq j$.
In terms of the above basis, the primitive tensor $m_i^* \otimes n_j \in M^*\otimes_F N$ is carried to $\Phi(m_i^* \otimes n_j) \in Hom_F(M, N)$, the linear transformation which sends $m_i$ to $n_j$ and $m_{i'}$ to $0$ for $i' \neq i$. In terms of matrices given by the above basis, this is the $\ell \times k$ matrix with a 1 in the $i^\text{th}$ column and $j^\text{th}$ row, and zeroes elsewhere. Since these form a basis for the space of matrices, it follows that $\Phi$ is surjective in this case.
In general, for arbitrary vector spaces $M$ and $N$, one can show that:
- $\Phi$ is one-to-one, i.e., a monomorphism, or an injective homomorphism.
- $\Phi$ is surjective if at least one of $M$ or $N$ is finite-dimensional.
- If both $M$ and $N$ are infinite-dimensional, then $\Phi$ is not surjective, for the following reason: the image of $\Phi(f_1 \otimes n_1 + \cdots + f_s \otimes n_s)$ can be easily seen to be contained in the vector space span of $n_1, \ldots, n_s$. However, there are (many) linear transformations from $M$ to $N$ which have an infinite dimensional image.
Once you've understood all of that, then you can come back here and formulate a better question. For now, I'll make a quick observation: For $R$ an arbitrary commutative ring, there is a similar notion of tensor product of $R$-modules, which satisfies the property that for $M, N$ a pair of $R$-modules, $M \otimes_R N$ is an $R$ module. The picture becomes very different when you define tensor products in categories of modules over noncommutative rings.