Yes, you can put the four diamonds in your bank after acquiring them in the Desert Treasure OSRS quest. This is actually recommended to avoid the Stranger coming after you.