I give an explanation that avoids the pejorative comments of Engineer.
First question: can you explain me these two definitions of perfect code?
Those are not two definitions of perfect codes but rather a single somewhat poorly-phrased definition of a perfect code. It should read
A perfect (binary) $t$-error-correcting code of block length $n$ is a set $\mathcal C$ of binary vectors of length $n$ that enjoys both properties listed below:
- Given any $\mathbf x$, one of the $2^n$ binary vectors of length $n$, there exists a codeword $\mathbf c \in \mathcal C$ such that $\mathbf x$ and $\mathbf c$ differ from each other in $t$ or fewer places, that is, every binary $n$-vector $\mathbf x$ is at (Hamming) distance $t$ or less from some (suitably chosen) codeword in $\mathcal C$.
- Each binary $n$-vector $\mathbf x$ is at distance $t$ or less from one and only one codeword in $\mathcal C$.
It is important to bear in mind that both properties must hold in order for $\mathcal C$ to be called perfect.
This definition is best understood in terms of the notion of Hamming balls in binary spaces. A Hamming ball of radius $t$ and centered at $\mathbf y$ is the set of all binary vectors $\mathbf x$ that are at Hamming distance $t$ or less from the center $\mathbf y$ of the ball. Note that a Hamming ball contains
$$\binom{n}{0}+\binom{n}{1}+ \cdots + \binom{n}{t}$$
binary vectors in it.
So, the first property says that if $|\mathcal C| = M$, then every binary $n$-vector $\mathbf x$ lies in one (or more) of the $M$ Hamming balls that are centered at the codewords, while the second property says that the Hamming ball that contains $\mathbf x$ does not contain any codewords other than the codeword at the center of the ball. Thus, the $M$ Hamming balls centered at the codewords fill the entire binary $n$-space without any overlap, that is, each $\mathbf x$ belongs in exactly one of the disjoint $M$ Hamming balls of radius $t$, and so we have a perfect packing of disjoint Hamming balls into the binary $n$-space. This is something that is impossible in our more familiar Euclidean spaces: non-overlapping balls don't fill entire spaces and there are always points in the space that don't belong in any of the balls.
Second question: I do not understand these two sentences.
The first sentence uses the fact that the $[7,4]$ Hamming code is a $1$-error-correcting perfect code and since every binary vector $\mathbf x$ must belong to a Hamming ball of radius $1$ centered on a codeword, it must either be a codeword (the center of the ball) or be one of the $n$ binary vectors at distance $1$ from the codeword at the center. In binary $n$-space, a Hamming ball of radius $1$ has exactly $\binom{n}{0}+\binom{n}{1} = n+1$ binary vectors in it.
The second sentence points out an addendum to the unstated notion that if $\mathbf c$ is the transmitted codeword and if the channel makes at most one error (flips no more than one of the transmitted bits), then the maximum-likelihood decoding algorithm, which maps received vectors into the nearest codeword, will decode correctly. The received vector $\mathbf x$ is at distance $0$ (no flips) or distance $1$ (exactly one flip) from $\mathbf c$ and so is in the Hamming ball of radius $1$ centered ar $\mathbf c$. The addendum, which is stated more explicitly, is that if two errors have occurred, then the received $\mathbf x$ lies in a Hamming ball centered at some other codeword $\mathbf c^\prime$ and so will get decoded into $\mathbf c^\prime \neq \mathbf c$ by the maximum-likelihood decoding algorithm, resulting in decoding error. Left unsaid (since these are presumably not things that are dreamt of in the book author's philosophy) are the facts that decoding errors will also occur if the channel makes three, four, five, six, or seven errors.