I have an 86 f-150 that i just removed a 302 from, so I know that a 302 will fit. the 302 and the 351 are almost a direct swap. The only changes I had to make to replace my 302 with a 351 were to modify the exhaust since the 351W is just a bit wider than the 302. If you go to a 351C, 351M, or a 400 you'll have to have a different transmission since the bellhousings are different. The 289, 302 and 351W are all small blocks and the others are big blocks. Of course you can MAKE almost anything fit, it's just a matter of how much work you'd like to do. I removed an EFI 302 and put in a Carbed 351W. Pretty easy swap and I have a ton more power now. Not sure I'd go back to a 302 if you've got a 351, but that's your call. What are you wanting to accomplish in a motor swap? Have you thought of rebuilding the 351? With some minor modifications you can get a ton of power from a 351W.
What year 302 upper (I am assuming GT40) did you use on your 351W EFI lower. I am trying to do the same thing. My 351W lower has round inline ports. I was told a Explorer would work but the first one I found has staggered ports.