Can you bug in if you live in the city? Absolutely you can. There are just some adjustments you need to make to your planning so that you can increase your chance of survival. Although most experts may recommend that you get out of the city if possible during a SHTF event, that just isn’t a possibility for some people. Perhaps you have extremely limited resources, a family member for whom travel would be life-threatening or other extenuating circumstances that mean leaving the city just isn’t a viable solution for you.
If you’re in the city and planning to bug in, the key difference that you have to account for is that people will be everywhere around you. So you are going to have to learn how to do everything that any other prepper needs to do: stockpile food, cook without electricity, find water and supplies, etc., but you will have to have even more stealth. And you will no doubt have more confrontations with other people, so you will definitely need to be more prepared to defend yourself.