I have heard that I could substitute egg yolk with coconut cream or
maybe it was coconut milk. Is this true? What is the purpose of egg
yolk in ice-cream?
Eggs are used to make a custard base, which when frozen has a rich flavor and creamy texture. Egg yolks also contain a lot of lecithin, a natural emulsifier which keeps fat and water from separating. That in turn helps to keep the ice cream smooth, perhaps by helping to keep the ice crystals that form during freezing small.
You don't have to use the eggs, though, and if you leave them out you generally don't need to cook the base first. Ice cream made without eggs (just milk and/or cream, sugar, and flavorings) is often known as "Philadelphia style," and because it omits the cooking step it tends to be very easy to make. It also tends to have a very fresh flavor which is well suited to fruit ice creams.
I've seen some recipes that have no eggs but include some lecithin. You might look into these especially if you want to make a higher fat ice cream with a creamier mouthfeel than you get from Philly style recipes.