The part of the shock that fits into the hub is smaller in diameter on the 2wd one, but it's enough difference that it would be extremely obvious, ie if you were to fit 2wd ones into 4wd hubs you'd nearly be able to fit a pencil between the shock and hub body with the shock in the hub.
The rears are the same apart from on oe fit ones where the bottom eye/tube part is around 1/2" wider/longer on the 4wd shock, I would imagine all the shocks would be made "2wd" and supplied with a 1/4" spacer either side to be fitted where needed, of course the lower mount on the arms is 1/2" wider on the 4wd arms due to this.
tabetha