That's a duct boot. What you are looking at is the side inside the AC closet, where the AC air handler will be. There will be flex duct connected between the air handler and the duct boot. The other side of the wall is the living space where the air will blow out, and it will have a grill/register on it. The boot is screwed to the studs inside the wall.
This side (on the inside of the AC closet) doesn't have to look great, but by default I think all drywall penetrations should be sealed somehow, just to keep drafts out, and keep air from streaming back into the AC closet.
The penetrations in the drywall of my existing garage are sealed with some kind of reddish, flexible, rubbery goop that's still not quite fully set even after 30 years. All the penetrations like where the garage door opener wires go through the drywall, or where the pipes for the softener system come through the drywall, are sealed with it. It's not caulk, it's not drywall mud, and it's not foam. I've been trying to figure out exactly what it is.