Hotels:
You definitely can and should keep your shoes on in hotels in Croatia. It's normal and expected to wear shoes in the lobby, corridors, hotel restaurants or bars, etc. Of course, outdoor shoes are usually not permitted in the spa area; either walk barefoot or use some indoor slippers (your own or provided by the hotel).
Most Croats would probably take off their shoes when entering a hotel room and then walk around the room barefoot. If it's your hotel room, the choice is yours. The hotel absolutely won't have any rules about footwear in the rooms. If someone invites you to their room, check if they have shoes removed and do the same.
Private homes:
Croatians observe the standard Eastern European etiquette of removing their shoes when entering a house or an appartment, whether one's own or someone else's. Things can be more relaxed in hot and dry areas when people walk around in flip-flops or similar, but even then, those can be quite dusty, so it's a better idea to remove them when going inside. The same default etiquette also applies to any form of private accomodation.
In any case, you should err on the side of caution. Only keep your shoes on if the host sees you removing them and tells you to keep them on. Make sure your feet don't smell and your socks are clean and not showing signs of excessive wear and tear!