The claim in the question is true . Here is a proof:
Let $[L:K]=d$. Since $L/K$ is separable, the number of $K$-algebra embeddings $u_i :L\to K^{alg}$ of $L$ into an algebraic closure of of $K$ is $d$.
Now if $a_1,...,a_d$ is a $K$-basis of $L$ we have an intermediate field $K\subset L'=K[a_1^p,...,a^p_d]\subset L=K[a_1,...,a_d]$
Since the extension $L'\subset L$ is purely inseparable the restrictions $u_i\mid L':L'\to K^{alg}$ are still distinct which proves that $[L':K]\geq [L':K]_{sep}\geq d=[L:K]\geq [L':K]$ so that $L'=L$.
This in particular implies that any element $\lambda \in L$ can be written as a sum of terms $q\cdot A^p$ with $A$ a monomial in the $a_1,...,a_d$ and $q\in K$.
Lemma The vectors $a_1^p,...,a^p_d$ generate $L$ as a $K$ vector space.
Proof of lemma Write as above any element $\lambda \in L$ as a sum of terms of the form $qA^p$.
Since in particular $A\in L$, we can write $A=\sum_{i=1}^{d} q_ia_i\;(q_i\in K)$ and thus $\lambda $ is a sum of terms of the form $q\cdot (\sum_{i=1}^{d} q_i a_i)^p=q\cdot (\sum_{i=1}^{d} q_i^pa_i^p)=\sum_{i=1}^{d}(q\cdot q_i^p) a_i^p$, which proves that the $a_i$'s generate $L$
End of proof of claim Since the $d$ elements $a_1^p,...,a^p_d$ generate the $d$-dimensional $K$-vector space $L$, thay are a $K$-basis of $L$.