If someone flees their country to another country as a refugee due to war , outbreak of disease , civil unrest etc , without any visa , is it legal for them to stay, work and have home etc as any other citizen of that inhabiting country ?
Most countries (if not all) allow refugees to stay, work, and establish a home, though not necessarily with the same rights as citizens. The Hague Convention Relating to the Status of Refugees of 1951, which most countries have implemented, provides that refugees should be treated like citizens in some respects, and like other non-citizens in other respects.
Their right to stay is governed by protection against expulsion and the principle of non-refoulement (articles 32 and 33). These protections differ from those afforded to a country's own citizens.
Their right to work is the same as other non-nationals. This is governed by articles 17 through 19.
Their rights to own property, to housing, and to freedom of movement and of choice of residence are the same as other non-nationals, and are governed by articles 13, 21, and 26.
Countries that are not parties to the convention, including the US, nonetheless grant similar rights to refugees.