Role of substrate geometry in sliding friction