Somebody did that back in the 1980s. They put a small printer into a phone that had the same form factor as a Western Electric model 500.[1]
This connected to a PBX and printed "While you were out" slips.
It was a real product, but did not catch on. Anyone remember that thing? I saw ads, but never one in person.
The problem with a production product is refilling all those little rolls of printer paper. They will always run out when no one is available to answer the phone, of course.