Consider the following definitions
where $\bf{F}$ is the real or complex number field and $\mathcal{L}(V)$ is the vector space of all linear operators on $V$.
I think that the notation $p(T)$ does not make sense as $T$ is not in the domain of $p$.
Am I right? If YES, So what is the right notation for this?


The notation is very common. If one is very strict one could see a problem, but I would say the main issue is at saying "$\mathcal{P}({\bf{F}})$ is the vector space of all polynomials from $\bf{F}$ to $\bf{F}$." Instead it is "the vector space of all polynomials over $\bf{F}$" or "with coefficients from $\bf{F}$."
A polynomial is an object in its own right.
The polynomial $P$ then gives rise to a map from $\bf{F}$ to $\bf{F}$ that is usually also denoted by $P$.
In the same way the polynomial $P$ gives rise to a map from $\mathcal{L}(V)$ to $\mathcal{L}(V)$ that is usually also denoted by $P$.
It is true that very strictly the polynomial and the maps it induces are different objects, but usually one does not distinguish those notationally.
Let me add that if you really insist that "$\mathcal{P}({\bf{F}})$ is the vector space of all polynomial [maps] from $\bf{F}$ to $\bf{F}$" then indeed there would be a problem. But I doubt that is actually what is done in your source, and if it were done then this would be the main problem.
Well, turns out this is done. In this way, the definition is not really coherent. The main problem is that the coefficients $a_i$ are not necessarily uniquely determined by the map $P$ from $F$ to $F$ and thus $P(T)$ is not well-defined (different choices of $a_i$ yielding the same function from $F$ to $F$ will yield different results for $P(T)$).
However, this is only an actual problem if the field is finite. If the field is infinite such as the reals or the complex numbers, than a polynomial map uniquely (up to spurious $0$ coefficients) determines the coefficients.
So that to each polynomial function one has a tuple of coefficients and then one defines $P(T)$ as it is defined. (Michael Hardy makes a very good point there.)
Either way, there is no problem to consider a polynomial as a formal expressions to begin with $a_0X^0+ a_1 X^1 + \dots + a_n X^n$. To define it as a function and then retrieve the coefficients is not my preferred way, but I can see why somebody might want to take it.