The Codex iuris canonici from 1983 says something about this:
Can. 932 §1. The eucharistic celebration is to be carried out in a sacred place unless in a particular case necessity requires otherwise; in such a case the celebration must be done in a decent place.
§2. The eucharistic sacrifice must be carried out on a dedicated or blessed altar; outside a sacred place a suitable table can be used, always with a cloth and a corporal.
So the normal case is to celebrate in a "sacred place" (a church, a private chapel etc.) and on an altar. But if there is a "necessity" ("necessitas") in a particular case, any other "decent place" is also possible. Than an altar is not obligatory (there are portable altars), but a "suitable table" is enough.
If there is a necessity the priest has to decide – he does not need the approval of his bishop or an other authority. A "necessity" is more than a "just cause" (often required in canon law), but is not bound to particularly grave causes such as emergencies.
So if there is no (big enough) church for the congregation, it is clearly possible to use another room or celebrate outside (so the General Instruction of the Roman Missal, n. 288). If it is only for the special atmosphere of a mass in the garden (I often attended such masses), one can argue if there is really a spiritual "necessity".
There are special provisions in can. 933 CIC for masses in a not-Catholic church.
Before Vatican II this was possible too, only under stricter conditions. The more important change is, that today an altar stone is no longer strictly needed. The Codex iuris canonici from 1917 says:
Can. 822. § 1. Missa celebranda est super altare consecratum et in ecclesia vel oratorio consecrato aut benedicto ad normam iuris, salvo praescripto can. 1196.
§ 2. Privilegium altaris portatilis vel iure vel indulto Sedis tantum Apostolicae conceditur.
§ 3. Hoc privilegium ita intelligendum est, ut secumferat facultatem ubique celebrandi, honesto tamen ac decenti loco et super petram sacram, non autem in mari.
§ 4. Loci Ordinarius aut, si agatur de domo religionis exemptae, Superior maior, licentiam celebrandi extra ecclesiam et oratorium super petram sacram et decenti loco, nunquam autem in cubiculo, concedere potest iusta tantum ac rationabili de causa, in aliquo extraordinario casu et per modum actus.
Normally the mass is celebrated in a church on an altar (§ 1). Some people (I don't know, who) have the privilege to use a portable altar by law or by special Apostolic indult (§ 2): they can say mass on any suitable place, but not on sea, and on a sacred altar stone (§ 3; the portable altars contained a stone). In extraordinarial circumstances the ordinarius (normally the bishop) can license to celebrate on any suitable place (but not in a bedroom) on a sacred altar stone (§ 4).
In 1963 the competence of the bishops was extended: they now were able to permit the celebration according to can. 822 § 4 CIC/17 in case of a just cause, for permanent cases a grave cause was needed ("ex iusta causa, habitualiter autem solummodo ex causa graviore", P. Paul VI., MP Pastorale munus, I n. 7). The new missal in 1970 already had in core the regulation later in can. 932 CIC/83. There was some discussion, if there should be an approval of the local ordinarius, but it was seen as unnecessarily complicated.
Literature: Althaus, in: Münsterischer Kommentar zum Codex Iuris Canonici, hrsg. von Klaus Lüdicke, Ludgerus Verlag (38. Lieferung Juli 2004), can. 932.