Detached garage: only if you use it as workspace. Attached garage: code requires a continuous thermal barrier between garage and living space, and foam works. Insulating the garage door itself usually has the highest ROI.
More detail
Garage foaming priorities depend on whether the garage is conditioned or attached to the house. (1) Detached garage used as workshop: closed-cell on walls and roof deck creates a workable conditioned space. Cost $3,500-$8,500 for a 2-car. ROI depends on actual use; weekend hobbyists rarely justify the spend. (2) Attached garage: the wall and ceiling between garage and house already requires fire-rated drywall with sealed penetrations per IRC; foam in those assemblies adds thermal performance and air seal but the priority is the boundary, not the garage interior. (3) Garage door: the single most cost-effective improvement for any attached garage. A foam-cored insulated garage door (R-12 to R-18) replaces a single-skin metal door (R-2) for $700-$1,500 installed and dramatically improves the temperature of any room sharing a wall with the garage. (4) Bonus rooms above garages: see the dedicated FAQ; foaming the garage ceiling is part of the package. Cincinnati garage-door upgrade context: a foam-cored insulated garage door (R-12 to R-18) replacing a single-skin metal door (R-2) is the highest-ROI upgrade for any attached garage. Cost $700-$1,500 installed. Especially impactful for bonus rooms above garages, where the garage temperature directly affects upstairs comfort. Many Cincinnati-area spray-foam projects include or coordinate with garage-door upgrade work.