Front and rear wheels don't make much difference in terms of traction, but they do make a difference as to the realism of a locomotive's setting. Typically a loco with no pilot or trailing wheels would be found in a yard, rather than out on the mainline pulling grades.
Era is important too--for a 1900 era layout, a Ten-Wheeler or Consolidation would provide suitable oomph. For a 1950 layout, an articulated compound locomotive of some sort, with two sets of drivers for more traction and lots of weight. In 2000, a diesel-electric with six-wheel trucks. Because, of course, traction motors are much better for low-speed groveling than high-stepping steam engine drivers.
And, of course, a geared locomotive is the best for traction, at least among small locomotives. Low gearing does the job.