As shipped by Malfador, you cannot store resources on ships. Haven't heard of a Mod that allows that either.
You do get resources back when you scrap a ship. Highlight the ship then look in the middle column. It shows how much you will get.
Thre are recycling facilities up the tech tree that allow you to get more resources back when you scrap ships at that particular planet. Of course you have to have a Space Yard at the same planet.