Yes, they can grow well indoors, depending on your light exposure. If you don't have a sunny window (as can happen when one is surrounded by tall buildings), you can get inexpensive grow lights like these to supplement the daylight. You *might* have trouble making the plants fruit if the light is too dim.
Another, more robust indoor pepper-growing solution is to get a grow tent, which allows for brighter lighting. A small grow tent like this one should hold a couple of pepper plants unless you choose a particularly large variety.
I have two of these and they are amazing. https://www.amazon.com/EZORKAS-Dimmable-Spectrum-Adjustable-Gooseneck/dp/B07ZHY1B4C/ref=mp_s_a_1_3?dchild=1&keywords=grow+lights+for+indoor+plants&pd_rd_r=2e96e3c7-b5e2-4ecc-86a3-eaa5f33d91eb&pd_rd_w=40bPL&pd_rd_wg=xCgQX&pf_rd_p=7596b9fd-ba12-49f5-ae8b-3f608226907c&pf_rd_r=A2HX3WKVSJ9BPYEVBJYF&qid=1615691777&sr=8-3
You gotta use Amazon correctly. They label them by best seller, most affordable, best rated. plant light off Amazon
I got mine on amazon. Works well and turns on and off automatically. Link: https://www.amazon.com/EZORKAS-Upgraded-Dimmable-Adjustable-Gooseneck/dp/B07ZHY1B4C/ref=mp_s_a_1_1?keywords=plant+grow+lights+indoor&qid=1576026850&refinements=p_72%3A2661618011&rnid=2661617011&sprefix=plant+grow+light&sr=8-1