Defining a fruit is difficult because definitions for fruit change based on the context. These definitions tend to overlap without distinction, so we end up with ambiguities like avocados, tomatoes, and strawberries. For my purposes, a fruit is the fleshy, seed-associated part of a plant that is other sweet or sour.
Fruits can be utilized in many ways. They can be added directly into a dessert (banana bread), frozen, turned into a syrup, or have their flavor extracted. If the goal is a syrup, it is ideal to boil the mixture prior to adding sugar. This boiling breaks down the fruits structure allowing its juices to leak out. If sugar is added before this occurs, then the fruit will shrink due to osmosis, which will leave behind a rigid structure.
In many recipes, the main fruit ingredient is slightly expendable, so it may be ideal to go with a fruit that is in season. Although, the structure, the texture, and the flavor of the fruit are important determinants for whether the available fruit can be used as a substitute.