Let $\pi$ and $G$ be finite groups with a homomorphism (action) $\pi\rightarrow G$. If $|\pi|$ and $|G|$ are relatively prime, then it can be shown that $Z^1(\pi,G)=B^1(\pi,G)$ (group of $1$-co-cycles is equal to group of $1$-co-boundries.
Hence if $G$ is abelian then $H^1(\pi,G)$ is trivial.
My question is
Does is always happen that both $Z^1(\pi,G)$ and $B^1(\pi,G)$ are also trivial when $|\pi|$ and $|G|$ are relatively prime (one may take case $G$ abelian and non-abelian separately for this question).
I assume that you mean an action of $\pi$ on an abelian group $A$ by group automorphisms, that is, a group homomorphism $ \pi \to \text{Aut}(A) $.
If both $\pi$ and $A$ are not trivial and the action of $\pi$ on $A$ is not trivial, neither $B^1(\pi;A)$ nor $Z^1(\pi;A)$ are zero. Recall that $C^n(\pi;A)$ is the abelian group of maps of sets $ f \colon \pi^n \to A$, and the coboundary map is given by
$$ \delta \colon C^n(\pi;A) \to C^{n+1}(\pi;A) $$
$$ (\delta f)(g_0,\ldots,g_n) = g_0 f(g_1,\ldots,g_n) + \sum_{i=1}^n (-1)^i f(g_0,\ldots,g_{i-2},g_{i-1}g_i,g_{i+1},\ldots,g_n) +(-1)^n f(g_0,\ldots,g_{n-1}) $$
In particular, $C^0(\pi;A) = A$, and we see it as maps from $\pi^0$, which is the set $\{*\}$ with only one point to $A$. Since the action of $\pi$ on $A$ in nontrivial there exist $g \in \pi$ and $a \in A$ such that $ga \neq a $. Let $c_a$ be the corresponding element in $C^0(\pi;A)$, that is, the map from $\{*\}$ to $A$ that sends $*$ to $a$.
Now consider $\delta c_a \in B^1(\pi;A)$. Then
$$ (\delta c_a)(g) = ga - a \neq 0 $$
Hence $\delta c_a$ is a nontrivial map and so $B^1(\pi;A) \neq 0$. Since $B^1(\pi;A) \subseteq Z^1(\pi;A)$, we also have $Z^1(\pi;A) \neq 0$.