Noiseless Channel Capacity Nyquist theorem proves that a signal of $B$ bandwidth, in order to be sampled correctly thus avoid aliasing, has to be sampled with a $f_c > = 2B$.
When it comes to calculating the capacity of a noiseless channel of bandwidth $B$, then this is calculated as:
$C=2B * \log_2 (M)$
where $C$ is channel capacity, and $M$ is the number of levels for the signal.
What I am not getting is the link between the two, cause for me one thing is to sample a signal of $B$ bandwidth and use so $2B$, while I do not succeed to digest the opposite, since a signal of $2B$ Bandwidth fits in a channel of $B$ Bandwidth only.
 A: The problem statement is rather strange, because it mixes concepts from channels with continuos time and discrete time.
Suppose first that we have a discrete-time channel which is noisless but is contrained to send one of $M$ "symbols" (what you call "levels") at each channel use (each "discrete time"). The capacity of such a channel is, clearly, 
$C_d = \log_2 M$ bits per channel use (always be careful with the capacity units).
If we can use that channel $N$ times in a time interval $T$, (that is, $N/T$ per second) then our capacity is $C= \frac NT C_d = \frac NT \log_2 M$  bits per second.
Now, the natural question would be: what is $N$, how many times per interval $T$ can I use my channel? Well, if the channel is bandlimited (frequencies $[-B,B]$), Nyquist tells me that I the critical sampling time is $1/2B$, so we have at most $2B$ "significant" values (or degrees of freedom) per second. Then you get $C = 2 B \log_2M$  bits per second.
The result is correct, but the explanation above is dubious. In particular, it's not clear at all how we would trasmit $N$ values with $M$ levels using a bandlimited signal during an interval $T$. Strictly speaking, that's not possible. We could think of a train of $N$ rectangular pulses, each having $M$ possible amplitudes;  but this would not be bandlimited. We could instead think of a train of $N$ sinc pulses - this would be bandlimited, yes, but not time limited. Generalizing, we could think of $N$ orthogonal functions $\psi_i(t)$  ($i=1\cdots N$), of which the above are particular cases, and which are approximately (the approximation getting better as $T$ grows) bandlimited and time limited; we "modulate" these funtions by multiplying by our desired values to transmit $x(t)=\sum a_i \psi_i(t)$ (each $a_i$ takes $M$ "levels", in our case). What Nyquist says, in this generalized formulation, is essentially the same at he said for the simpler "sampling" scenario: we can find at most $2B T$ such functions. The format math behind this is quite complex (see eg).
For the application to channel capacity (and how one maps discrete-time to continous-time channels), see MacKay, chapter 11.
A: I found this thread because I had the same doubt. The answers I found here were not enough for me, so I did further research. I will try to clarify a bit the topic by providing some simple practical considerations. First of all, even if the Nyquist theorem is somehow connected (it was a prerequisite for the development of Shannon's theory), the link is not so easy to understand (but you can read this really good paper that gives some hints). Thus, I will initially focus on the second part of your question: "while I do not succeed to digest the opposite, since a signal of 2B Bandwidth fits in a channel of B Bandwidth only". Here the confusion lies between the quantity of information per unit of time, that the C represents, and the frequency of a signal, that are two different concepts. To give you an example, fast ethernet has a total throughput on the physical layer of 125Mbps. If you see the signal on a spectrum analyzer, you will find that it has a minimum at 125MHz and it is also possible to demonstrate that 65MHz of bandwidth on the cable is enough to transmit this amount of data per second. This is a consequence of how the bits are physically coded. To put it simply, one is high voltage and zero is low. Let's say for example that we are transmitting at 100Mbps. From the needed bandwidth perspective, the worst case condition is a pattern like 10101010... But if you send 1 after every 0, this means that you are sending 50.000.000 "ones" per second, thus you are sending a square wave at 50MHz. The spectrum of an ideal square wave has only odd harmonics and just taking the first one allows the circuitry on the receiving side to reconstruct the sent data, even if it is not enough to reconstruct the waveform. Bottom line, reconstruct a waveform and ensuring a correct data reconstruction are two different beasts and, for the latter, a bandwidth in Hz just above half of the required data throughput in bps is technically enough (no noise and two "levels").
A: The multiplier 2 comes from the fact in time interval 1 sec, we have 2B samples. Therefore, given to modulation scheme, we have that formula.
in fact, since the channel does not have loss, the capacity is equal to bit rate of the source !
So, you have a channel with "whatever you want" Capacity !
