In NestJS, DTOs enforce data contracts by defining the expected shape and types of data using classes and decorators. When data arrives from a client, it is checked against the DTO. If the data matches the expected types and required fields, it passes validation and is safely used by the service. If the data is missing fields or has wrong types, validation fails and an error is returned. This process ensures that the application only works with safe, predictable data, preventing bugs and security problems. The execution table shows examples of data passing and failing validation, illustrating how DTOs enforce these contracts step-by-step.