Two Palestinians were killed and one was wounded in an explosion on Sunday in a building in Gaza, health officials said.