I know of one independent place that happily refills the containers they use, if you bring them back clean. In this case the container is used as a portion measure so it wouldn't work with arbitrary dishes. In this case they were the typical plastic takeaway boxes (amazon link). A couple of my colleagues did this; I didn't as I could dishwash and reuse them at home instead (you only get a few uses out of them anyway)
This is in the UK where we're fairly strict on food hygiene but less worried about litigation than some places. It may be against a strict interpretation of the rules. If food is kept hot (or promptly and properly reheated), the risks from invisible contamination should be vanishingly low.
I wouldn't expect a discount (except maybe a token amount) as these containers are cheap -- the amazon listing above works out to 13p (<$0.20) each and they'd cost a lot less than that wholesale.
The reason this isn't more common is probably the same reason that many ideas here aren't common -- nobody cares (to a good approximation of "nobody"). Few individuals could be bothered to wash them up. For big businesses it would save very little and they'd be worried enough about liability to incur costs just for considering it.