Running electrical cable within dry wall
The short answer: no. Electrical cable needs to be stapled to the side of the studs, halfway between the two walls, to minimize the risk that anyone will nail or screw into the electrical wire and electrocute themselves. Any time an electrical wire or plumbing pipe comes too close to the face of the stud (e.g. if the hole going through the stud weren't centered), you have to install steel safety plates.

For ethernet, you can run it behind the trim or lots of other places without concern.