Sometimes they did! At the Battle of the Somme, several divisions dug what were known as "Russian saps" into No Man's Land before H-hour: this effectively consisted of a tube of explosives pushed just under the earth and then blown up. Voila, instant trench. Despite our stereotype of lines of men walking obediently across No Man's Land to be mown down, more often than not attacking units were able to break into the first line of enemy trenches. The greatest casualties came when the defenders brought up reserves and the attackers were unable to bring in their own owing to difficulties with communications. It shouldn't be much of a surprise that where the British made their greatest gains on the First Day of the Somme, methods like Russian saps, or crawling into No Man's Land just before the barrage lifted, were combined with the heaviest artillery bombardment on the front.
Here we see opposing trenches. Attacks were performed by running across the relatively elevated land between them. Why not simply dig a trench in a straight line towards the enemy, perpendicularly out of your trench (in the photo this would have been from left to right)?
/u/RobWithOneB has mentioned 'Russian Saps' which are essentially what you suggest. However, digging these towards the enemy would give them an indication of where you planned to attack. This was a reservation voiced by a number of British commanders prior to the opening of the Somme Offensive.
As can be seen from other answers here, they did indeed dig straight towards the enemy line on occasion, for a number of different purposes.
One must remember before I go on that the Western Front (to which I presume we're talking about here) was not entirely uniform. In some parts, the area between the front line trenches was a considerable distance. In others it was short enough that stronger soldiers could throw a Grenade into an opposing front line trench with some physical effort. In addition to the varying distances between front line trenches, the type of soil the combatants were fighting in also played a role in determining how much tunneling or sapping went on.
In areas where a wider "No Mans Land" was present, the kinds of entrenchments you refer to, known as "Saps", were indeed dug. These didn't just involve tunneling efforts, but also included more overt uses... Saps provided several uses, including a means to move troops to pre-determined assault or raid "start lines" forward of front line trenches (this technique meant the attacking force would avoid any inevitable artillery response to a pre-deployment bombardment or supportive creeping barrage), to Observation Posts established at the end of a sap to allow for advance warning of enemy action.
The latter was especially relevant to the British in 1917 and 1918 after they had being dealing with the German concept of Defence in Depth, and had taken steps (for a number of reasons, shortage of infantry being just one of them) to replicate it themselves.
Some of the posts here regarding Russian Saps and Tunneling are also relevant, notable British battles where tunneling was heavily utilised include the opening day of the Somme offensive, Vimy, Messines and a number of other battles. Whilst a significant activity of this tunneling was dedicated to attempting to breach enemy lines with explosives, the Battle of Arras actually featured significant tunneling in an attempt to move reinforcements, supplies, and wounded in tunnels.