How much can you generalize the notion of an ideal/normal subgroup/kernel of a homomorphism? An ideal in a the kernel of a ring homomorphism. Similarly, a normal subgroup is the kernel of a group homomorphism.
One thing that immediately jumps out at me is that rings and groups are both single-sorted equational theories and they both extend the theory of a single monoid $\langle 0, + \rangle$ where $+$ is constrained to be associative and $0$ is constrained to be an identity.
A homomorphism $f : A \to B$ where $A$ and $B$ are algebraic structures of the same signature satisfies the rule: For every equation $\varphi(\vec{v})$ and variable context $\vec{v}$ such that $A, \vec{v} \models \varphi(\vec{v})$, it holds that $B, f(\vec{v}) \models \varphi(\vec{v})$. This notion of a homomorphism can be defined without referring to the underlying equational theory, we can consider the structures $A$ and $B$ is isolation without thinking about where we got them.
I think this means that if I have an algebraic signature $\sigma$ extending $\langle 0, + \rangle$ and a theory $T$ extending $(a+b)+c \approx a + (b+c) \;\;\text{and}\;\; a+0 \approx a \;\;\text{and}\;\; 0+a \approx a$, then I can define some kind of ideal.
It might be possible to extend this even further to multi-sorted equational theories like the theory of a single category, but the most straightforward way to do this that I can think of produces a disjoint connection of monoid ideals on something else that's not very interesting.
How far can you generalize the notion of an ideal / kernel of a homomorphism?
 A: There is more than one way to generalize this concept, so I hope others can give other answers, but here is my favorite way:
Lets consider the kernel of a group homomorphism $\phi : G \to G'$. The kernel is often defined to be $\ker (\phi) = \{g : G | \phi (g) = 1_{G'} \}$, where $1_{G'}$ is the identity of $G'$. In order to generalize this, it will be very helpful to characterize the kernel in terms of a universal property (don't worry if this concept isn't familiar, we only need a very specificity instance of it, which I will explain). The universal property of the kernel in an arbitrary category with $0$ morphisms is described here.
I will describe this construction specific to groups. First note we have an inclusion morphism $u : \ker(\phi) \to G$ given by $g\mapsto g$. We also have a morphism $\ker(\phi) \to 0$ given by $g \mapsto 1_{G'}$. It is important to note that this map factors as $0_{GG'}:=¡_{G'}\circ!_G: G \to 0 \to G'$, where $0$ is the trivial group. It is easy to verify that $u$ satisfies $\phi\circ u = ¡_{G'}\circ!_G$.
The universal property of the kernel states that, for every group $X$ and homomorphism $f : X \to G$ such $\phi\circ f = ¡_{G'}\circ!_G$, there exists a unique $s : X \to \ker(\phi)$ such that $u\circ s = f$. In other words, $u$ is the universal morphism from $\ker(\phi)\to G$ such that $\phi \circ u = ¡_{G'}\circ!_G$.
It is easy to show using that property given about determines $\ker(\phi)$ uniquely, up to unique isomorphism. That is, any other group with the above property is isomorphic to $\ker(\phi)$ via a unique isomorphism that commutes with $u$.
This universal property tells us that the following is a pullback square:
$\hspace{4cm}$ 
What is interesting to notice is that did not refer much to the the group structure of $G$ or the fact that $\phi$ is a group homomorphism in order to construct the kernel this way. Thus, we can repeat this construction in any category with similar structure. Indeed, we can repeat this construction in the category of rings, and many others. All that was necessary for this construction is the zero object $0$ and the existance of pullbacks.
But, may favorite way to generalize the kernel is when we move from algebraic objects to spatial ones, like topological space or, better $\infty$-groupoids. Lets look at an analog of the kernel in (a nice) category of spaces. You could take this to be some subcategory of topological spaces, say CW-complexes, though the specifics will not matter for our purposes. Such a category does not have a $0$ object (an object with unique morphisms to and from it to ever other space). To remedy this, we look at the category of pointed spaces. In this category, the one points space $*$ is a zero object. Thus we can repeat the kernel construction for a continuous map $f : X \to Y$ by taking the pullback as we did for groups. This pull back has the explicit description as the set $\{x : X | f( x ) = y_0\}$ with the subspace (of the product) topology.
However, this construction turns out to be rather uninteresting in the context of algebraic topology and specifically homotopy theory. Rather, the proper generalization of the kernel to homotopy theory is something called the homotopy fiber of a map. The problem is that we took the pullback of $f$ when we need to take the homotopy pullback of $f$. Luckily, the homotopy pullback of $f$ has a fairly simple description in this instance:
The homoptopy fiber of $f : X \to Y$ over $y_0$ is $F=\{(x,p) \in X \times Y^I| p(0)=f(x) \land p(1)=y_0\}$. That is, $F$ is the set of pairs of points $x\in X$ and paths $p$ in $Y$ starting at $f(x)$ and ending at $y_0$.
One way of looking at the problem with taking the strict pullback of $f$ is the it required points to be strictly equal to $y_0$. Instead, we need to loosen this constraint and only ask that points have a path to $y_0$.
A bit of digression to relate this to part of your question about "can we generalize the kernel to categories": what I have described is essentially the generalization of the kernel to $\infty$-groupoids (under the homotopy hypothesis). We can look at the homotopy fiber of $1$-groupoids. If we restrict our attention to the pointed connected case, this turns out to correspond to the kernel of the corresponding group. There is a bit of a caveat, since we are not really looking at groups, but instead are looking at their delooping. So you have to look at loops in the fiber. Nonetheless, we really can see this as a generalization of the kernel of a group. We can also look at the corresponding construction for categories. If we take $F : C \to D$ a functor and a point $d_0$ in $D$, we can look at the comma object $F\downarrow d_0$. The reason you ended up with something uninteresting may be because you looked at the strict pullback.
The homotopy fiber is extremely useful for a number of reasons. My favorite reason is that it allows us to construct the fiber sequence of a map (or try this). The fiber sequence of a map is an interesting end in and of itself. But it can also allow the easy computation of homotopy groups. However, I won't go into the definition of the fiber sequence, or any of its applications, here. But I hope you get a chance to check it out!
A: In any category we define the kernel pair of a morphism $f : X \to Y$ to be an object $K$ and a pair of morphisms $p, q : K \to X$ such that $f \circ p = f \circ q$ and that is universal among such.
That means, given any object $K'$ and morphisms $p', q' : K' \to X$ such that $f \circ p' = f \circ q'$, there is a unique morphism $k : K' \to K$ such that $p = k \circ p'$ and $q = k \circ q'$.
What does this mean concretely?
Well, if the category is the category of sets, we can concretely define $K = \{ (x_0, x_1) \in X \times X : f (x_0) = f (x_1) \}$, $p (x_0, x_1) = x_0$, and $q (x_0, x_1) = x_1$.
The same in any category of algebras (by which I mean models of a one-sorted equational theory with only operations and no relations).
Clearly, the kernel pair defines a congruence on $X$.
You can check that $X$ modulo this congruence is naturally isomorphic to the image of $f : X \to Y$.
But the notion of kernel pair makes sense in any category, and we might try to play the same game and see if we win or not.
First of all, the kernel pair is a congruence – this remains true in any category.
We can define the quotient of a congruence to be the coequaliser of its projections.
This is not guaranteed to exist, but when it does, we get a morphism from the quotient to the codomain of the morphism we started with.
Here is where things get tricky: this morphism from the quotient to the codomain is not guaranteed to be a monomorphism, and even when it is, it is not guaranteed to the minimal monomorphism through which the original morphism factors.
For example, in the category of topological spaces, kernel pairs and coequalisers exist, and the morphism from the quotient to the codomain is a monomorphism (= injective continuous map) but not necessarily an embedding (= injective map that is a homeomorphism onto its image).
One class of categories where the quotient of the kernel pair has the properties we come to expect from algebraic categories is the class of regular categories.
The definition varies but at minimum a regular category is a category in which every morphism has a kernel pair, every kernel pair has a coequaliser, and pullbacks of regular epimorphisms are regular epimorphisms.
(Incidentally, the category of topological spaces fails on this last point, as does the category of categories and the category of posets.)
