Sure, it can. Not everybody can do it, because you need at least a little space and a little light, not to mention a little time to tend your plants.
But most people can at least do a window box or two, or three. Some people have front or back yards which can be gardened. And some places have allotment gardens with garden spaces which people can sign up for, often for free.
This is a good site to start looking at for some tips: