It all depends how much work you’re willing to do and what your goal for the appearance is. In order of increasing effort…
For most amateurs, filling the gap with any sort of foam, caulk, mortar, mud, etc. will look, well, not much better than it does now.
Jaketrades’s moulding idea is better, and not much work.
If the wall has no windows or other obstructions, putting another layer of drywall over the whole wall would cover the gap. You could use one of a number of edge trims with a tear-away bead for the drywall that would make a perfect edge along the brick.
You could build bookcases and/or cabinets for a TV, etc. on either side of the fireplace. They would completely cover the sides of the fireplace brick, making that gap disappear.