My background before CMA was judo, karate, TKD/TSD, etc., all barefoot. Some on mats, some on carpets, some on hardwood floors. Also as a kid, we also often walked to the beach and back every day in summer, about 1.75 to 2 miles each way, barefoot (I used to hate flip-flops). Maybe I was lucky, but I never got any infections, etc. on my feet; only issue was the first hot day of summer, I’d sometimes get blisters on my soles from the hot blacktop, which cleared fairly quickly back then, as your feet toughen up. I wouldn’t do that now, but you’d be surprised how your feet can adapt to going barefoot. How do the native tribes do it in places like Papua New Guinea, many African countries, etc.
In the past, I’ve tried various types of shoes in training, some just for the experience, some used regularly…tai chi slippers (no good), sneakers, deck shoes (my favorite), steel-toed workbooks, and even cowboy boots once or twice (it was the 90s). You get to feel how they all affect your balance, speed, mobility, etc., in different ways, and the advantages/disadvantages of each.
As already mentioned, even when you train with shoes, you need to be aware of hygiene. If the training is indoors, only use a dedicated pair of shoes for that and don’t wear them outside.
There are some MA’s that I would NOT recommend practicing shoeless, such as some of the northern-style CMA that incorporate a lot of stomping into their practices, at least not on a plain hard surface.
When I train on my own at home, I go barefoot, but if doing CMA away from home now, I’ll always wear shoes.