According the Catholic interpretation of the passages in the O.P.'s question, there is no contradiction between them.
To see this, it is helpful to look at the broader context of Hebrews 13:10. Chapter 13 is essentially an exhortation to live Christian charity, and in general living the Christian life, in its various aspects:
Let brotherly love continue. Do not neglect to show hospitality to strangers, for thereby some have entertained angels unawares. Remember those who are in prison, as though in prison with them, and those who are mistreated, since you also are in the body (Heb. 13:1-3, ESV).
Part of living the Christian life is adhering to the true doctrine and not being led astray by heresy:
Jesus Christ is the same yesterday and today and forever. Do not be led away by diverse and strange teachings, for it is good for the heart to be strengthened by grace, not by foods, which have not benefited those devoted to them.
It is not certain what “foods” the author is referring to here, but it seems likely that he is referring to the meat that is sacrificed, either in the Jewish temple or at pagan temples. (In both cases, the priests would often eat a portion of the sacrificed meat.)
If we assume that the author is referring to the Levitic priests of the Old Testament (as he did in Hebrews 10), then verse 10 seems easier to interpret:
We have an altar from which those who serve the tent have no right to eat.
“Those who serve at the tent” (οἱ τῇ σκηνῇ λατρεύοντες) would, then, be the Levitic priests. The “tent” would, therefore, refer to the Tent of the Meeting or “Tabernacle” that was used in Israel from the time of Exodus to the construction of the Temple.
In any case, whether it is the Levitic priests or pagan priests, what the author of Hebrews appears to be saying is that we Christians have an “altar” that those priests—since they are unbaptized—do not have a right to serve at (and hence cannot partake of the sacrificial banquet).
Hence, the “altar” mentioned could indeed be taken to represent the place where the Eucharistic Sacrifice is offered; but the author is saying, in essence, that the non-Baptized, even if they are priests in their own religion, are not to partake of it (and cannot benefit from it if they attempt to do so).
There is no contradiction, therefore, with John 6:54, in which Jesus tells his followers that his flesh (interpreted by Catholic exegetes to mean the Eucharist) is the means par excellence to obtain eternal life:
Whoever feeds on my flesh and drinks my blood has eternal life, and I will raise him up on the last day (John 6:54, ESV).
In other words, argues the author of Hebrews, despite the fact that they make many sacrifices of animals, until they are baptized, even the priests of the pagan and Jewish religions will be excluded from the heavenly banquet (the Eucharist) that brings them eternal life.
(Source for these reflections: the Ignatius Study Bible: New Testament.)