Nissan's Leaf has the ability to do this (V2G or V2H) and the devices needed to enable it are starting to become available[1].
It's a shame they're not more widespread though. A lot of 1st generation EVs are available secondhand for much less than the cost of a Tesla PowerWall, despite larger batteries.
[1] https://www.greencarreports.com/news/1127590_nissan-leaf-as-...