This paper investigates the prescribed-time output consensus (PTOC) of heterogeneous multi-agent systems (MASs) based on sampled data. Firstly, a novel dynamic compensator is designed for each agent and its state is used to interact with its neighbors. Then, a hybrid sampling strategy (HSS), including a dynamic event-triggered sampling (ETS) and a time-triggered sampling (TTS), is developed to determine when to sample and broadcast the compensator state of agents. The execution of the HSS is divided into two steps, a dynamic ETS is presented before the first prescribed-time (PT) where the dynamic threshold decays to zero as time approaches the first PT. Subsequently, a TTS with a constant sampling period (CSP) is introduced after the first PT. With the proposed HSS, all compensators achieve the state consensus at the first PT while excluding the Zeno behavior. Based on the proposed dynamic compensators and the HSS, a fully distributed controller with high scalability and flexibility is developed. Through the Lyapunov stability theory, it is proved that the heterogeneous MASs with the proposed controller achieve the output consensus at the second PT (after the first PT). Finally, a simulation example on 8-wheeled mobile robots is performed to verify the validity of the theoretical results.