If you had your thinking cap on when you read the story of Cain and Abel, then you should have made certain observations. These guys are building alters and offering sacrifices, but at this point no Law has been given nor instructions for such things as alters and sacrifices. Had God told them personally to make such an offering? If you have such questions, then good for you. You’re paying attention. I can’t answer your questions, but it’s a good sign you have them.
If those guys making sacrifices bothers you, just wait till you hit Genesis 14. Abram is blessed by Melchizadek, priest of God Most High. Still no Law, no Moses nor Aaron, to temple or tabernacle, but here is a guy worshiping God Most High, blessing people, and apparently receiving tithes. If Cain and Abel gave you some questions, Melchizadek ought to give you an aneurysm.
Read Abraham Meets a Priest at Bible Survey.