[Apologies: the answer I wrote below is for $S^2 \times S^1$, not the 3-torus. Corrections added. The case of a 3-torus, or any 3-manifold, is included at the end.]
First, there are different kinds of "trefoil knots" in $M = S^1 \times S^2$. Let's say we are interested in the "split trefoil knot", which
lies in a 3-ball in $M$. This does in fact occur as a leaf of a foliation and it is easy to see.
To build it, first recall the standard foliation of $S^3$ by circles where the one leaf is the trefoil knot $T$. This can be obtained by taking the orbits of the
circle action $(z,w) \mapsto (t^2 z, t^3 w)$, $|t|=1$, on the 3-sphere in $\mathbb C^2$.
Next we observe that the trefoil knot $T$ and a "disjoint" (split) unknot $U$
in $S^3$ can arise as the leaves of a foliation of $S^3$. (Split means there is an $S^2$ separating $U$ from $T$). To see this, consider the unknot $U'$ in (2) that arises as the orbit of $(z,w) = (1,0)$. This would almost do, except that $U'$ links $T$, i.e. $U'$ and $T$ are not split.
To fix this, we use the fact (mentioned by Zare) that the space of constant slope foliations of a 2-torus is connected (it is just a circle). First adjust the foliation in (2) so it contains a solid torus $D^2 \times S^1$ foliated by $p\times S^1$'s with $U' = 0 \times S^1$. Here $D^2 = D^2(1)$ is the unit disk. By rotating the foliations on the tori $N_r = S^1(r) \times S^1$ as $r$ varies from 0 to 1, we can arrange that for some $r>0$ the torus $N_r$ is foliated by leaves of the form $U = S^1(r)\times p$, $p$ in $S^1$. Each of these leaves is an unknot split from $T$, so we have shown 3.
To complete the picture, we now observe that $S^2 \times S^1$ can be obtained from $S^3$ by Dehn surgery along $U$, i.e. by cutting out a solid torus (disjoint from a ball containing $T$) with core curve $U$ and gluing it in again differently. Using the rotating foliation idea again, it is easy to extend the foliation from (3) to a foliation of $M$ with $T$ as a leaf. By construction, $T$ is a split trefoil in $M$.
Case of the 3-torus: It is also true that for any closed 3-manifold $M$ and any
link $L$ in $M$, there exists a nowhere zero vector field on $M$ such that $L$ is invariant under the flow. One way to see this is to use Zare's construction, which depends on two facts: (a) $M$ can be obtained by Dehn surgery on a link $L'$ in $S^3$ (Lickorish) and (b) any link $L''$ in $S^3$ can be presented as a closed braid (Alexander). This construction will be a little less explicit than the one above, since it uses (a) and (b).
The main point is to prove the statement when $M=S^3$. For this one can start with
any flow (e.g. the Hopf flow) such that there exists a closed trajectory.
Thickening this flow line, we obtain an unknotted torus $S^1\times D^2$ with the product
foliation. The foliation is obtained by suspending the identity map $D^2 \rightarrow D^2$.
Now let us present $L$ as the closure of a braid $B$ with $n$ strands. Then $B$ can
be obtained by suspending a diffeomorphism of $D^2$ to itself, fixing the boundary, and permuting $n$ points. Plug this new foliation into the original $D^2 \times S^1$. We then have a flow on $S^3$ such that $L$ is periodic.
For the general case, let $W = L' \cup L''$ such that $M$ is obtained by Dehn surgery on $L'$, and $L''$ becomes the desired link $L$ in $M$ after surgery. Then apply the construction above to $(S^3,W)$, and rotate the foliation near $L'$ as in step (5) above so it is compatible with Dehn surgery.