Modular Virasoro vertex algebras and affine vertex algebras