You can cook an egg in butter or oil, and it's a personal preference more than anything. Some people choose one over the other for health reasons or flavor. I think it's easier to use oil when making basted eggs because the butter can burn off too quickly.