Edit:
There are one 3-d matrix $A = [ A_1 \ A_2 \ ... \ A_K]\in\mathbb{R}^{K\times D\times K}$ and $A_i\in\mathbb{R}^{D\times K},i=1,...,K$, and a 2d matrix $B = [B_1 \ B_2 \ ... \ B_k ]\in\mathbb{R}^{K \times K}$, where $B_i = [b_{1i},...,b_{Ki}]$. What I want to get is $C = [A_1 B_1, A_2 B_2, ..., A_K B_K] \in \mathbb{R}^{D \times K}$. How can I do this using tensor product? I am a little confused about the dimension coordination.
It's not clear what "do this using tensor product" is supposed to mean. However, we can write the desired tensor in summation form. Let $A_{i,j,k}$ denote the $i,j$ entry of the matrix $A_k$, and let $B_{i,j}$ denote the $i$th entry of $b_j$. We can write that for $1 \leq j \leq D$ and $1 \leq k \leq K$, the $j,k$ entry of $C$ is given by $$ C_{j,k} = \sum_{p=1}^K A_{j,p,k} B_{p,k}. $$ We could express this matrix as a contraction of the $D \times K \times K \times K$ tensor $\tilde C$ with entries $$ \tilde C_{j,k,p,q} = A_{j,p,k}B_{q,k}. $$ Neither $C$ nor $\tilde C$ can be expressed as the "tensor product" of $A$ and $B$ in the conventional sense. If you insist on relating this to a tensor product somehow, then you might find it notable that we can write $$ \tilde C_{j,k,p,q} = (A \otimes B)_{j,p,k,q,k}. $$ In other words, $\tilde C$ consists of the "diagonal elements" of the tensor product $A \otimes B$.