To advertise OSPF-learned routes to BGP neighbors on Junos, you must explicitly control route redistribution using policy. Junos does not automatically redistribute routes between routing protocols simply because both protocols are enabled. Instead, you create a routing policy that matches the routes you intend to export, in this case routes whose protocol origin is OSPF. The policy must accept those matched routes so they become eligible for advertisement.
After the policy is created, you must apply it as an export policy under the relevant BGP group or under the BGP protocol hierarchy, depending on your design. Export policy controls what your router sends to BGP peers. When the export policy accepts OSPF routes, Junos advertises those routes to the BGP neighbors in that group, subject to any additional BGP constraints such as next-hop handling, route families, and any peer-specific policy terms.
Creating a policy to match and accept BGP routes is not required for this goal because that would influence what routes are imported into your routing table from BGP, not what you export. Likewise, applying a policy as a BGP import policy affects received routes, not OSPF-to-BGP redistribution. In data center fabrics, this policy-driven approach prevents unintended route leakage and keeps redistribution tightly scoped to the prefixes that must be carried between domains.