Yes, you can, with the determining factors as enough light (sunlight or artificial light), space, a nutritious growing mix and your own available time.
Getting the light right
Vegetables, fruit and herbs need at least six hours of sunlight a day. That may be possible in homes with sunny windowsills, patios or courtyards and east, north or west facing rooms that allow in plenty of bright light.
If that is not the case, you can simulate those conditions by using LED Grow Lights, which are stronger (20 to 40 watt) compared to household LED lights (9 watt). When grown under lights, edibles need eight to 12 hours of light a day and seedlings up to 14 hours. The lights must be switched off for at least