Yes, it worked pretty much in the exact dual way: If $(C, \Delta)$ is a nonunital coalgebra, then $C \oplus k$ has a co-algebra structure given by:

$$ \Delta'(c + x)= \Delta(c) + c \otimes 1 + 1 \otimes c + x ( 1 \otimes 1) $$

where $c \in C$, $x \in k$ and $1$ denotes the units of $k \subset C \oplus k$

This coalgebra structure has a counit given by the projection $C \oplus k \rightarrow k$ and is universal amongst counital coalgebra with a morphism to $C$.

Maybe I can make this a little more formal: it actually really is the exact dual of what happen for algebras.

Indeed, the construction you describe for algebra actually works in any additive monoidal categories (where the tensor product is additive):

If $A$ is a non-unital monoid in $(C,\otimes)$ an additive monoidal category then $A \oplus 1_C$ with the operation as in the question (using that $\otimes$ distributes over $\oplus$ to make sense of these formulas) is the universal unital monoid object generated by $A$.

Now the opposite of the category of $k$-vector spaces is still monoidal and additive so this applies to monoids in this category which are exactly co-algebras. A very short computation shows that dualizing the formulas for algebra gives the formula I've written above.