Is a Roman Catholic allowed by Church law to receive sacraments from other Churches in full communion with Rome? In a simple example, a Roman Catholic gets an invitation from a Maronite Catholic to attend Mass in the latter's rite. Can a Catholic participate in the Mass to the point of receiving Communion from the Maronite priest?

With regards to once-in-a-lifetime sacraments such as Baptism, Confirmation, and Matrimony, can a Roman Catholic receive such sacraments from other churches, provided that such church is in full communion with Rome? (Maronites, Chaldeans)
In short: yes, you can validly receive any of the sacraments in any Church that is in union with Rome.
From the Code of Canon Law:

Can.  844 §1. Catholic ministers administer the sacraments licitly to Catholic members of the Christian faithful alone, who likewise receive them licitly from Catholic ministers alone, without prejudice to the prescripts of §§2, 3, and 4 of this canon, and ⇒ can. 861, §2.

Catholic minister means any properly ordained person from a Catholic Church in union with Rome (see &quot;Can. 846 §2. The minister is to celebrate the sacraments according to the minister’s own rite.&quot;)

§2. Whenever necessity requires it or true spiritual advantage suggests it, and provided that danger of error or of indifferentism is avoided, the Christian faithful for whom it is physically or morally impossible to approach a Catholic minister are permitted to receive the sacraments of penance, Eucharist, and anointing of the sick from non-Catholic ministers in whose Churches these sacraments are valid.

This means that in cases it is impossible to find Churches in Union with Rome, it is permissible to receive them from non-Catholics whose sacraments are valid (basically the Orthodox Churches), but only of they allow that. The fact that a Catholic is allowed to, say, receive communion, in an Orthodox Church, does not mean that this Church automatically allows this Catholic to participate and/or receive.

§3. Catholic ministers administer the sacraments of penance, Eucharist, and anointing of the sick licitly to members of Eastern Churches which do not have full communion with the Catholic Church if they seek such on their own accord and are properly disposed. This is also valid for members of other Churches which in the judgment of the Apostolic See are in the same condition in regard to the sacraments as these Eastern Churches.

Similar to the above point, but the other way around.

§4. If the danger of death is present or if, in the judgment of the diocesan bishop or conference of bishops, some other grave necessity urges it, Catholic ministers administer these same sacraments licitly also to other Christians not having full communion with the Catholic Church, who cannot approach a minister of their own community and who seek such on their own accord, provided that they manifest Catholic faith in respect to these sacraments and are properly disposed.

And this waives (to some extent) the restrictions on §3 and §3 in case of mortal danger, meaning that also members of protestant churches whose sacraments are not recognized as valid can approach Catholic priests, if they present faith in the relevant sacrament and are properly disposed.

As to the second question in regards to singular sacraments (baptism, confirmation and matrimony), as stated above those sacraments are valid and recognized if administered in a Church in union with Rome. This does not automatically change the rite of the child: if Latin parents go to an Eastern rite church (which they freely can), and have their child baptized there, the child still remains Latin.

Can. 111 §1. Through the reception of baptism, the child of parents who belong to the Latin Church is enrolled in it, or, if one or the other does not belong to it, both parents have chosen by mutual agreement to have the offspring baptized in the Latin Church. If there is no mutual agreement, however, the child is enrolled in the ritual Church to which the father belongs.
Can. 112 §1. After the reception of baptism, the following are enrolled in another ritual Church sui iuris:

[...]

Can 111 §2. Anyone to be baptized who has completed the fourteenth year of age can freely choose to be baptized in the Latin Church or in another ritual Church sui iuris; in that case, the person belongs to the Church which he or she has chosen.

There are other consequences attached to going to other rites, for instance the fact that if belonging to a Latin rite, children aren't allowed to receive in Eastern Rite churches until they fulfill the Latin Rite conditions for such, which differ from the Eastern rites (even though Eastern rite children not meeting those Latin Rite criteria are still allowed to receive communion in Latin Rite churches).
So while the short answer is indeed 'yes', it isn't a matter of 'free-for-all' cherry-picking for some of those other sacraments. One remains officially part of their own Church sui iuris, and thus subject to all the requirements in accordance to that Church.
Important to note is the following:

Can. 112 §2. The practice, however prolonged, of receiving the sacraments according to the rite of another ritual Church sui iuris does not entail enrollment in that Church.

Repeated receipt of sacraments in other Churches does not change your own affiliation.