I should clarify something here. It's not that one head gasket or the other won't match up. It's that the passages on the block are physically offset from those on the head. No matter what head gasket you might use the passages still won't match up. Subaru uses the same head bolt spacing on pretty much all the blocks and heads. This just make manufacture tooling much easier, not to mention head design modifications for the future. It is much easier to improve upon something when certain variables are fixed & you know what you have to work with.
You could NOT use EJ25 heads on a EJ18 block. The valves would hit the block deck when they open. You would have to bore the EJ18 to, at least, 94mm, in which case you now have an EJ22 block. As for putting WRX heads on an EJ18. Yes it will fit. NO, it will not work. That is unless you think coolant and oil flow are not neccessary.
Another thing is that both the DOHC and SOHC EJ25 heads are physically shorter than the WRX heads. This is in reference to stack height. The WRX heads flow much "faster" by having straighter intake/exhaust ports to/from the combustion chamber. Conversely, all other N/A heads in the N. American market are considerably shorter. Both EJ25 heads flow more "volume" than the WRX heads b/c the inlet and outlet ports are much larger but they are shorter & curved. This curvature reduces the air velocity thereby reducing the flow numbers but the ports are still very large making up for lesser velocity.
That being said the DOHC EJ25 heads in particular flow more overall volume than the WRX heads at the same pressure. Now remember that the WRX heads are designed for pressurized air. For efficiency/reliability sake, it makes sense that you would want to get pressuresized air in and out of the combustion camber ASAP. For a turbo, the rising, accerative rate of combustion is greater served by high speed rather than volumetric efficiency. For N/A combustion is better served by volume rather than velocity. Sucking vs. forced induction.
BTW, the block Subaru uses for N/A is completely different in design and many characteristics than the 1994cc turbo block, which is different. The difference is obvious when you look at them side by side.
The EJ18 is one block. The EJ22T is another completely different to anything else, although some might arugue it's closer to the EJ18 than the newer EJ22. I belive it was a test bed for new design features to arrive later on the N/A EJ22. The EJ22 is the completely re-engineerd version of the N/A EJ18 block but different in many vital ways & remained unchanged until 2000 when they dropped production of it in favour of the PhaseII EJ25. The PhaseI EJ25 is a bored and stroked version of the EJ22. The PhaseII EJ25 has some minor tweaks in the name of efficiency & strength & is still currently used for N/A applications. The EJ20 turbo block has remained largely unchanged since 1993. Remember, we're talking just blocks here.