The torque $ \tau $ on an electric dipole with dipole moment p in a uniform electric field E is given by $$ \tau = p \times E $$ where the "X" refers to the vector cross product.
Ref: Wikipedia article on electric dipole moment.
I will demonstrate that the torque on an ideal (point) dipole on a non-uniform field is given by the same expression.
I use bold to denote vectors.
Let us begin with an electric dipole of finite dimension, calculate the torque and then finally let the charge separation d go to zero with the product of charge q and d being constant.
We take the origin of the coordinate system to be the midpoint of the dipole, equidistant from each charge. The position of the positive charge is denoted by $\mathbf r_+ $ and the associated electric field and force by $\mathbf E_+$ and $ \mathbf F_+$, respectively. The notation for these same quantities for the negative charge are similarly denoted with a - sign replacing the + sign.
The torque about the midpoint of the dipole from the positive charge is given by
$$ \mathbf \tau_+ = \mathbf r_+ \times \mathbf F_+ $$
where
$$ \mathbf F_+ = q\mathbf r_+ \times \mathbf E_+(\mathbf r+) $$
Similarly for the negative charge contribution
$$ \mathbf \tau_- = \mathbf r_- \times \mathbf F_- $$
where
$$ \mathbf F_- = -q\mathbf r_- \times \mathbf E_-(\mathbf r-) $$
Note that
$$ \mathbf r_- = -\mathbf r_+ $$
We can now write the total torque as
$$ \mathbf \tau_{tot} = \mathbf \tau_- + \mathbf \tau_+ =q\mathbf r_+ \times (\mathbf E(\mathbf r_+)+\mathbf E(\mathbf r_-))$$
It is clear that in taking the limit as the charge separation d goes to zero, the sum of electric fields will only contain terms of even order in d.
Noting that $$ \mathbf |r_+| = \frac{d}{2} $$
and defining in the usual way $$ \mathbf p = q\mathbf d = q(\mathbf r_+ - \mathbf r_- ) $$
We can write that $$ \tau_{tot} = \mathbf p \times \mathbf E(0) + \ second \ order \ in \ d $$
As we take the limit in which d goes to zero and the product qd is constant, the second order term vanishes.
Thus, for an ideal (point) dipole in a non-uniform electric field, the torque is given by the same formula as that of a uniform field.
Note that it is not correct to start with the expression for a force on an ideal/point dipole in a non-uniform field and then calculate torque from this force. To derive this expression one ends up first taking the limit of a point dipole (on which there is zero force in a uniform field) and then one finds a torque of zero, which is incorrect. One must start with the case of a finite dipole, calculate torque and only then pass to the limit.
When p and E are parallel and anti-parallel, the torque is zero, so yes zero is possible. But the case in which p and E are anti-parallel is one of an unstable equilibrium, and a small angular perturbation will cause the dipole to experience a torque which attempts to align the dipole with the electric field.
When we introduce the idea of dipoles to students, we start off with macroscopic dipoles (like hand-sized bar magnets) for pedagogical reasons. In both the electric and magnetic cases, the dipole moment has an electromagnetic piece and some physical size: charge times length for the electric dipole, and current times area for the magnetic dipole. Your question here is about the interior field of the dipoles, where the distance from the center of the dipole to the point of interest is less than the length scale of the dipole.
However, outside of teaching examples, the region of interest for a dipole field is usually the "far-field" region, where the distance from the center of the dipole to the point of interest is much larger than the length scale of the dipole. In this limit the two dipole fields really are the same: there's a field along the axis of the dipole moment that is parallel to the dipole moment vector, and a slightly weaker return field In the equatorial region, and both of these fields vary like $r^{-3}$ as the distance $r$ from the dipole varies.
In short: yes, there's a tiny region in the interior of an electric dipole where the field points the "wrong" way. But if you are close enough to the charge distribution that you care about this detail, then the dipole approximation is not the tool that you need to solve your problem.
Best Answer
If it is a static case, the curl of E is zero, and that type of electric field can't act on a dipole. THIS ANSWER DOES NOT APPLY TO THE QUESTION ASKED. DISREGARD IT. I had thought the question was about an E field that varied perpendicular to its direction. Sorry about that chief.