When buying a roundtrip flight ticket, a single ticket and a single PNR (Passenger Name Record) is issued. But I've heard that one can cancel a single leg of that roundtrip booking. How is that possible? They told me that this tickets have two "coupons", and they cancel the coupon instead of ticket. I would be glad if someone gives me a reference about this concept or explain that to me
When understanding how airlines work even in 2019, you generally need to look back to how things were done 50+ years ago, as mostly the concepts are the same.
There's basically 3 concepts that are relevant here - "Reservation" (or PNR), "Ticket" and "Coupon".
When you first make a reservation, a "PNR" is created. This is basically an (at this stage) unpaid temporary reservation on your flights. This is where the airline confirms there are seats available for you on the flights you want (and temporarily reserves those seat for you), sets the price, and then sets the deadline on when the ticket needs to be purchased/paid for (normally within a day or two, but could be as much as weeks later). One PNR can cover multiple flights, and might even cover flights on multiple airlines.
When you actually pay for the flights, a "ticket" is issued. Historically this would have involved a travel agent taking a physical, blank ticket, filling in the details, and then giving it to the customer.
That "ticket" would have physically had multiple "flight coupons", which were basically individual pieces of paper that were allocated one per flight. When you boarded the flight, the agent would take the "coupon" corresponding to that specific flight, at which point the coupon was considered used.
When airlines moved to fully computerized, they kept the same concepts as with physical tickets. So instead of a ticket, you now have an 'eTicket' which is simply a computer record matching what was physically a ticket. This eTicket still has the concept of one 'coupon' for each flight on the ticket, and when you fly that flight the coupon is 'pulled' - which now simply means that it's marked as used in the computer record.
As far as your question around cancelling a coupon v's cancelling a ticket, this really is just the difference between removing one flight from your existing eTicket (ie, removing the 'coupon' for that flight), or cancelling the entire ticket (which will remove all coupons). Which of these is available as an option will depend on the conditions of the fares that you've bought, and the airline in question. Some airlines will allow you to simply void a coupon without changing the price of the ticket, however most airlines will require you that the ticket be "re-issued" which will trigger things like a re-pricing of the ticket, charging of change fees, etc. There's no single answer as to exactly how this will work given that there's so many variables...
At the end of the day, these concepts are now just nothing more than entries on a computer - so if they wanted to the airline could allow anything. In general what is and is not allowed is a business decision by the airline. eg, if the options are to let you simply cancel a single coupon v's being able to charge you $XXX to make a change to your ticket, there's a benefit to them of taking the latter option!