Yes. Fruit and vegetable waste is the core of most domestic compost piles. It is nitrogen-rich, high in moisture, and breaks down fast. The only real management issue is fruit flies, which is solved by burying it. Below: whether you can compost fruit, why, how much to add, and the mistakes that cause trouble.
Adding fruit to a pile. Chop it, mix it, bury it.
Why
Fruit and vegetable matter is soft tissue with high water content and readily available sugars. Microbes reach it immediately, which is why a caddy of scraps heats a pile within a day or two.
Because it is so wet, it needs dry material alongside it or the pile becomes sodden.
How to add it
Chop larger items. A whole cabbage or a melon rind is dense and slow. Bury each addition under browns.
Roughly half your pile by volume can comfortably be food scraps, provided the other half is dry material.
Common mistakes
Leaving scraps exposed on the surface. Fruit flies within days.
Adding only scraps, with no browns. The single most common beginner pattern.