Goldfish and koi are both members of the same family -- Cyprinidae -- and they have basically the same body shape except for a few minor differences. Trouble is, both types of carp are omnivorous and will readily eat young fry. It is important to protect the smaller fish as much as possible until they grow to the point where they are safe.
Adult goldfish can vary in size from around 5 inches to around 18 inches, depending on the type of goldfish and size of its environment. The newly hatched fry of a koi are very tiny and are easily eaten by larger fish, including larger koi fry. Once the fast-growing fry have reached about 1 month of age, they are no longer in danger as they should already be around 1 to 1 1/2 inches long.
Giving the newly hatched koi places to hide is one way to help them survive living with goldfish, and live plants are perfect for this -- but keep in mind that as the fry grow, the plant life will deteriorate as koi love to nibble on greens. It's best to re-plant with each generation of koi fry or use plastic plants in the pond. Also, bricks with holes in them are perfect for small fish to hide in.
Goldfish and koi are both friendly fish and are not usually aggressive, although both will readily devour anything they are able to fit into their mouths. Larger koi, for example, have been known to eat small water-dwelling animals such as frogs. Goldfish easily accept newcomers into their environment, so transplanting young koi fry into a goldfish pond is fine, once the koi fry have grown to be around an inch long. Before that is too soon.
Size of the Environment
Since koi are such large fish, they should not be kept in aquariums, but they're perfect for outdoor ponds where they can stretch out and grow to their maximum size, which can be 2 feet long for some koi. Since goldfish are much smaller, about 18 inches long, it won't be long until the koi fry outgrow their adult goldfish counterparts. Make sure the pond is large enough to accommodate both types of fish.