For any algebra, the answer is no.
Consider, for example, lattices (or semi-lattices).
Among these, consider chains.
If two elements in a chain are related, that tells you nothing about all other elements but the ones that are in the interval whose least and greatest elements are the given elements.
This works, for example, for Boolean Algebras, where congruences are given by the class of $0$ (equivalently, by the class of $1$), which is an ideal (the class of $1$ is a filter).
But in this special case, we also have that Boolean Algebras are term-equivalent to Boolean Rings, and as you say, it works for rings, with the ideals.
It also works for Heyting Algebras (but I think it is only via filters, not ideals), and for many other varieties, but right now I don't know if there is a characterization of these.
Edit:
Even for Boolean Algebras (and thus, also for Heyting Algebras) this doesn't work completely.
If $\mathbf{B}$ is a infinite Boolean Algebra, then $\mathbf{B}$ has at least one ultra-filter $U$ which doesn't have a minimum element, and so this subset cannot be seen as a subalgebra.
Principal filters don't have this limitation and so if $\mathbf{B}$ is a finite Boolean Algebra, then you have the desired property; for infinite ones, no (only for the congruences associated with principal filters).
Of course you always have homomorphic images, but that is obvious, and you're asking for subalgebras...
Edit 2:
While what I wrote in the previous paragraph is true, it is perhaps a bit misleading.
The reason is that, the relevant question is not if a congruence is determined by a subalgebra, but if it is determined by a single congruence class, that is associated with some special subset of the original algebra.
Actually, if you have a ring $\mathbf{R}$ with unit $1$, then the only ideal that is a subalgebra of the ring is $R$ itself.
The reason is that if it is a subalgebra, it must contain the nullary operations, such as $1$, and an ideal that contains $1$ is the whole ring.
So in the sense of Universal Algebra, ideals are not, in general, subalgebras of the rings (although normal subgroups are subalgebras of their groups).
That said, in a Heyting Algebra, you have a correspondence between congruences and filters: if $\mathbf{H}$ is a Heyting Algebra, $\theta$ is a congruence and $F$ is a filter, then
$$F_{\theta} = \{ x \in H : x \theta 1 \}$$
is a filter and
$$\theta_F = \{ (a,b) \in H^2 : (a \to b) \wedge (b \to a) \in F \}$$
is a congruence.
Moreover, $\theta_{F_{\theta}} = \theta$ and $F_{\theta_F} = F$.
Boolean Algebras can be seen as Heyting Algebras, if we define $a \to b = a' \vee b$.
Again, this works for many other cases.