Taking your shoes off in public can be rude depending on where you're at in public.
If you're in a restaurant or other food establishment then yes it can be very rude to remove your shoes and you'd likely be asked to leave for health reasons.
If you're at a sporting event or something outside then it is usually okay to remove your shoes or if you're out at a table outside eating food then it may be okay to take your shoes off in public.
Even at work in an office where you don't deal with customers etc it can be okay sometimes to remove your shoes.
But ask your boss first or if you do remove your shoes and your boss notices and does not like it then they will just warn you first.
Taking your shoes off in an office can be okay as long as your boss says it's okay.
Some offices want their employees to wear shoes or at least some slippers even when sitting at a computer and desk.
However wearing regular shoes can get uncomfortable and I asked my boss one day when I used to work in an office if it would be okay to take my shoes off while at my desk and he said it was fine.
I just had to put my shoes back on when I walked around the office which was okay with me.
I became much more productive when working with my shoes off as I hate wearing shoes and my feet start hurting as well.
I work from home now so I can go barefoot etc all over my house.
But if I had an office and had employees I would allow them to remove their shoes when at the desk as it does increase productivity and makes the employee more comfortable as well.