Both are measures to demarcate the boundary between the property and the street.
The inuyarai's main purpose is to protect the walls from dust and spatters of dirt and not, as their name might suggest, to keep dogs from marking their territory on the wall (although they manage to do that, too). They are normally made out of bamboo and slightly curved, but sometimes one can find inuyarai made out of metal, adding to the individuality of the houses. Nowadays, many inuyarai are also made out of plastic that is shaped and painted like bamboo.
Komayose look similar to fences and function as boundary markers as well. There are stories that horses and cattle were also tied to them to prevent the animals from walking away, but it is not sure wether those stories are true or not.