Under noiseless conditions, you can create a encoding circuit, using Gottesman's algorithm for any $[[n,k,d]]$ stabilizer code. You can input any arbitrary $k$-qubit physical state, known or unknown, into this circuit and it will produce the corresponding logical state.
If you require fault-tolerance, then you can only prepare a known arbitrary state $|\psi\rangle_k$. By known state, I mean that you know a circuit $C$, such that $C$ acting on $|0^k\rangle_k$ creates $|\psi\rangle_k$. To do this, first create a logical zero state in a fault-tolerant fashion.
- Start with $|0^n\rangle_n$.
- Measure all the stabilizer generators.
- Use the outcome of these measurements to compare all subsequent syndrome measurements to.
With $|\bar 0\rangle_n$ in hand, use a fault-tolerant version of $C$ to create $|\bar\psi\rangle_n$.
Why can't you fault-tolerantly encode arbitrary unknown states? Well, suppose someone gives you a $|\psi\rangle_k$. And suppose you have some hypothetical fault-tolerant circuit [1] $C_F$ that will transform all such states to $|\bar\psi\rangle_n$. Well, think about the moment in time just before the first gate of $C_F$ is applied to $|\psi\rangle_k$. If an error occurs at this point, then there is nothing $C_F$ can do to identify the error, let alone correct it.
Technically, a fault-tolerant operation is one that restricts logical error probability to $\mathcal{O}(p^2)$, where $p$ is the physical error rate. An error that occurs just before the first gate in $C_F$ is a $\mathcal{O}(p)$ event, and it destroys the logical state with the same probability. Hence, the probability of logical error is $\mathcal{O}(p)$, and the circuit is not fault-tolerant.
[1] The hypothetical is that the circuit is fault-tolerant, not that it exists. We have already shown in the first paragraph that such circuits exist.