A restraining order creates legal obligations for the person it is issued against, not necessarily for the facility housing them, and that distinction matters for both questions here.
On the letter, the facility's mailroom staff have no access to restraining order information and no mechanism to screen incoming mail based on civil protective orders. A letter mailed to an inmate reaches them through the standard mail process regardless of any restraining order that exists between the sender and the recipient. The mailroom looks for contraband and policy violations, not civil court orders. The letter would get through.
On phone calls, the jail's phone system is not configured to cross-reference restraining orders against an inmate's approved call list. If the number is on the approved list and the inmate chooses to dial it, the system will connect the call. The facility is unlikely to intervene.
Here is where it gets legally complicated. A restraining order prohibits the person it is issued against from making contact with the protected party. If the inmate knowingly calls or responds to someone who has a restraining order against them, they are potentially violating that order regardless of who initiated the contact. Violating a restraining order while already incarcerated adds a new charge on top of whatever they are already facing, which compounds their legal situation significantly.
The protected party initiating contact by sending a letter does not dissolve the restraining order or give the inmate legal permission to respond. If contact is genuinely desired by both parties, the appropriate path is going back to the court that issued the order and requesting that it be modified or lifted.