Yes, you can define
custom resolutions wider than 4096 pixels on OS X 10.9.5 and above, but only if you use SwitchResX 4.5 or newer.
OS X prior than 10.9.5 cannot manage such resolutions.
(Note that scaled resolutions can be defined up to 32768 pixels in all macOS versions, but most Intel Macs will not handle scaled resolutions wider than 4095 or sometimes 8192 pixels; when M1& M2 Macs only handle scaled resolutions up to 6016 pixels wide, and M1 & M2 Pros up to 7360 pixels).
In all cases, defining such resolutions doesn't mean that they will all activate, depending on the driver and macOS limitations.