According to Japanese custom, people are supposed to take off their shoes when entering a house. The shoes are taken off at the genkan (threshold, or entrance area) inside the house and one has be careful not to step on the genkan with their barefeet or socks (Japanese step out of the heels of both shoes first and then step into house without stepping on the threshold). The custom was developed to keep the floors in the house and especially hard-to-wash tatami mats clean.
Often Japanese step into slippers for walking around in the house but remove their slippers when entering a tatami-mat room. If you go the bathroom you put on a pair of plastic slippers in the bathroom and then change back into the original slippers when you step out of the bathroom.
It takes some skill to take off and especially put on your shoes at the door with grace and ease. It is a bad idea to wear hiking boots are shoes that require lacing up or are difficult to step in and out of. The custom of removing shoes was developed when people mostly wore sandals. Shoe horns are often available. If you need to sit to put on or remove your shoes apologize.
In Japan, there are too kinds of dogs: small dogs that are allowed in the house and outdoor dogs that have to stay outside and are not allowed inside because of worries that they will dirty the floor or the tatami mats with their feet.