Yes, you can. Sunscreen protects the skin from UVB rays, which are the main cause of sunburn and skin cancer, but also the rays that are responsible for producing Vitamin D. You can still get enough Vitamin D by spending some time in the sun without sunscreen, or by taking supplements.