D-Specs are basically discontinued in this country for now.
Tokico US has been shutdown for a little over a year and everyone that I know of has long sold their old D-Specs for the WRX. Best bet these days if you want a good adjustable shock is the Koni Sport inserts.
You could use your 02 housings or the 04 housings with the Koni inserts. Both will work.
You'll need new rear top hats to fit them. You should replace the fronts too just due to wear.
That being said '04 STI struts are already 11 years old. Most of these cars are going to have HIGH mileage, more than you want when it comes to buying new struts. If they are new, incredibly low mileage, or you plan on rebuilding them though, that's a different story.