First, cars are much more sensitive to whether the front or rear wheels are driven than tracked vehicles are to where the tracks are driven from. Performance-wise, having the drive sprocket in the front or rear (or even in the middle) are similar. Rear drive is, in principle, a little more efficient
The choice of front or rear drive determines where the transmission is located: in the front for front drive sprocket, and in the rear for rear. Since the driver sits in the front, this determines where the transmission is relative to the driver. With front drive, the transmission is typically next to the driver:
This means that the driver's controls connect directly to the transmission. If the engine is in the rear (as usual for WWII tanks), the cost is the weight of a long drive shaft running from the engine to the transmission.
With rear drive, the transmission is typically behind the engine:
The driver's controls must be connected to the transmission via long rods or cables, which, if they have too much play/slack, can make it harder to drive the tank. In addition, a rear transmission can mean that the transmission needs to be removed before removing the engine. Also, since the transmission is behind the engine, the engine sits further forward, and therefore the turret must be further forward. The impact of this is very visible when comparing, e.g., a Panzer IV and T-34 side-by-side:
The turret location affects weight distribution, and can result in an unbalanced tank if upgunned.
Some additional effects:
Rear drive sprockets jam more easily due to rocks etc. carried by the tracks.
Front drive sprockets are more likely to be damaged by driving into obstacles, gunfire from the front, or by mines.
References:
The model photos showing the interior layouts are from https://www.themodellingnews.com/2020/05/preview-135th-scale-pz-kpfw-iv-ausf-j.html and https://www.themodellingnews.com/2019/04/construction-guide-pt-1135th-scale-t.html
The last model photo is from https://www.warlordgames.com/head-to-head-panzer-iv-ausf-h-vs-t3485/