I don't believe a complete answer is known. Let me give you the following two nearly-contemporaneous references from the mid-70s:
Robert Guralnick, On groups with decomposable commutator subgroups
Michael Miller, Existence of Finite Groups with Classical Commutator Subgroup
Both Guralnick and Miller call groups which are commutator subgroups $C$-groups (though I don't know who, if either, originated the term) and give partial answers to your general question. For example, Theorem 4 from Miller gives the following:
Let $G$ be a subgroup of $\operatorname{GL}_n(K)$ containing $\operatorname{SL}_n(K)$ for $K$ a finite field of characteristic not equal to 2. Then $G$ is the commutator subgroup of some group unless it is of odd index and $n$ is even.