Yes, objects in one layer can have direct dependencies among each other, sometimes even cyclic ones - that is actually what makes the core difference to the allowed dependencies between objects in different layers, where either no direct dependencies are allowed, or just a strict dependency direction .
However, that does not mean they should have such dependencies in an arbitrary manner. It depends actually on what your layers represent, how large the system is and and what the responsibility of the parts should be. Note that "layered architecture" is a vague term, there is a huge variation of what that actually means in different kind of systems.
For example, lets say you have a "horizontally layered system", with a database layer, a business layer and a user interface (UI) layer. Lets says the UI layer contains 20at least several dozens different dialog classes.
One may choose a design where none of the dialog classes depend on another dialog class directly. One may choose a design where "main dialogs" and "sub dialogs" exists and there are only direct dependencies from "main" to "sub" dialogs. Or one may prefer a design where any existing UI class can use/reuse any other UI class from the same layer.
These are all possible design choices, maybe more or less sensible depending on the type of system you are building, but none of them makes the "layering" of your system invalid.