All chili species and varieties are self-fertile and have pollen and stigma in one blossom (autogamy). No female and male flowers here,
same for tomatoes. Actually most night shades are self-fertile (tomatillos are an exception, there is need of at least two plants of a kind). Cucumber, gourds and pumpkin have female and male flowers.
Indoors you have a lack of insect activity and wind (no so called biotic pollination) you need to give a little help by gently shaking chili plants or bushes, when flowers are open and have pollen. And for cucumber and relatives it is best to manually pollinate a female flower with a male-one. Of course you need to wait maturity and available female blossoms as well as male pollen in male flowers.
Pollination
PS: hybridization is another topic and problem (cucumbers, tomatoes and chilies) as it is frequent. If you have different cultivars and varieties growing close you need to protect blossoms if you want to avoid hybridization between varieties.