Yes, there do exist some Wi-Fi capable printers that allow you to print to them via their Wi-Fi interface, without requiring the printer and client device to be connected an existing infrastructure Wi-Fi network. However, this is not a universal thing. Basic Wi-Fi support in a printer does not guarantee support for anything other than joining an existing AP as a client device.
Over the years, there have been several different ways of supporting what you're looking for, including:
Sometimes called "ad hoc" mode. This is a peer-to-peer (really multiple peers to multiple peers) Wi-Fi mode that doesn't require any device to act as the AP (wireless router). All the peers connected to the IBSS take turns transmitting beacons and responding to Probe Requests. This way the IBSS's SSID is discoverable (that is, its network name shows up in your scan list of network names) and joinable even though there is no AP coordinating everything. Some early Wi-Fi printers would come up in this mode by default so that you could discover them from your wireless laptop, connect to them wirelessly, and get them set up to join your "real" (infrastructure mode, AP-based) Wi-Fi network. But some could stay in this mode indefinitely and just let you join the IBSS network whenever you wanted to print.
One downside to leaving a printer in IBSS mode is that you'd have to leave your main network and join the IBSS in order to print. But the IBSS wouldn't have any Internet connectivity (the printer wasn't acting as a bridge or router or gateway of any kind), so trying to print a web page or some document that resides on a network file server could be a pain, because you'd lose your Internet connection when you switched over to the printer's IBSS network to print.
Some printers that supported this mode may have either acted as a DHCP Server by default, or supported IPv4 link-local addressing (Microsoft calls this "APIPA"), so that you wouldn't have to manually configure IP addresses.
IBSS was kind of a hassle in some ways, so some printers have their Wi-Fi come up in AP mode by default, but again, it's just so you can see its SSID and join it and either just print, or set it up to become a Wi-Fi client of your existing AP-based Wi-Fi network.
Beware not to read too much into the term "AP mode" here; I'm only referring to its role in the 802.11 protocols. No printer that I'm aware of ever acts as a true bridge/router/gateway, so once again, if you join the printer-hosted AP-mode network, you won't get Internet connectivity. It sucks to have to lose your Internet connectivity any time you want to print.
Printers that supported this mode were more likely to act as a DHCP server on their printer-hosted network, because DHCP client support is more universal than even IPv4 link-local addressing and the rest of IETF ZeroConf tends to be.
Sometimes also called Wi-Fi P2P, This was the Wi-Fi Alliance's first attempt to come up with a protocol that would allow two Wi-Fi capable devices, in Wi-Fi radio range of each other, to discover and communicate with each other without using an infrastructure Wi-Fi network, and in fact even if each device was simultaneously connected to a separate infrastructure Wi-Fi network, even on separate channels.
As I recall, the spec provided for automatic IP address assignment, name resolution, and service discovery, so you could hopefully count on those things working without additional work.
However, it didn't work very well and never saw wide adoption. However, I seem to recall that several printers from big name consumer printer companies did support it.
If it had been good enough to find market success, it would have been nice because it didn't require you to lose your existing infrastructure Wi-Fi capability just to talk to a nearby device that's not on the same network as you.
It might be used by some things like Miracast.
I'm pretty sure I've seen the occasional Wi-Fi printer with a Wi-Fi Direct logo on it. I've never tried printing via Wi-Fi Direct myself.
Sometimes called "Neighbor Awareness Networking" (NAN), this is the Wi-Fi Alliance's latest attempt to do about what they tried to do with Wi-Fi Direct, but hopefully do it successfully this time. It remains to be seen whether it will see the market success that has eluded IBSS and Wi-Fi Direct, but I'm not terribly hopeful.
I've never tried printing via true Wi-Fi Aware myself.
I think some printers that support Apple's AirPrint technology may have supported an Apple technology called AWDL (Apple Wireless Direct Link) which was something of a precursor to NAN / Wi-Fi Aware. In many ways Wi-Fi Aware is a descended from AWDL.
Edited to Add: Apparently HP also has their own thing they call "wireless direct" in some of their printers. They mention it in conjunction with Wi-Fi Direct, but I'm not sure how related they are.