Two Scottish towns have been named among the most affordable town in Britain for families looking to buy a home.