There is no obligation to attach an outlet box to a stud. There are many applications where a box is "free floating" in a plaster wall using boxes that have various types of flanges that lock the box in. Boxes are sometimes embedded in wooden boards, such as baseboards.
The important thing is to ensure that the box is firmly secured. This could be done by screwing the box into the brick (using masonry anchors) through an existing opening in the box. It may be more practical to obtain "old-work" type boxes that have their own retaining mechanisms. the box is slipped in, then the retaining mechanism is tightened to grip the back of the plaster and lathe.
The most important code sections to be aware of when installing outdoor receptacles, are 314.15, 314.23, and 406.8(B)(1).
First off, the box should keep water out.
National Electrical Code 2008
ARTICLE 314 Outlet, Device, Pull, and Junction Boxes; Conduit Bodies; Fittings; and Handhole Enclosures
314.15 Damp or Wet Locations. In damp or wet locations, boxes, conduit bodies, and fittings shall be placed or equipped so as to
prevent moisture from entering or accumulating within the box, conduit
body, or fitting. Boxes, conduit bodies, and fittings installed in wet
locations shall be listed for use in wet locations.
Secondly, the cover should also keep water out even when things are connected.
ARTICLE 406 Receptacles, Cord Connectors, and Attachment Plugs (Caps)
406.8 Receptacles in Damp or Wet Locations.
(B) Wet Locations.
(1) 15- and 20-Ampere Receptacles in a Wet Location. 15- and 20-ampere, 125- and 250-volt receptacles installed in a wet location
shall have an enclosure that is weatherproof whether or not the
attachment plug cap is inserted. All 15- and 20-ampere, 125- and
250-volt nonlocking receptacles shall be listed weather-resistant
type.
Lastly, you'll want to make sure the thing isn't laying in the mud. Depending on the Authority Having Jurisdiction (AHJ), you might get away with attaching the box directly to the tree, or supporting it with the conduit used to supply it. The proper way to do it, however, would be according to 314.23 (B). Use a stake.
314.23 Supports.
(B) Structural Mounting. An enclosure supported from a structural member of a building or from grade shall be rigidly supported either
directly or by using a metal, polymeric, or wood brace.
(2) Braces. Metal braces shall be protected against corrosion and formed from metal that is not less than 0.51 mm (0.020 in.) thick
uncoated. Wood braces shall have a cross section not less than nominal
25 mm × 50 mm (1 in. × 2 in.). Wood braces in wet locations shall be
treated for the conditions. Polymeric braces shall be identified as
being suitable for the use.
Common sense says you should install the box up out of puddles, and if you get snow in your area above the normal snow level. There are no code sections that deal with the height above grade, so use your best judgement. And never forget the most important code section of all...
110.12 Mechanical Execution of Work. Electrical equipment shall be installed in a neat and workmanlike manner.
Best Answer
I see two options. What I see in the US quite a bit is instead of running the plastic channels on the wall surface, people will use steel conduit. It gives kind of a rustic/industrial look. Receptacles would then be mounted in steel boxes on the wall surface as well.
What is typical in Germany, where most walls are block and plaster, is that grooves are cut into the plaster, conduit laid into the grooves, and then the whole thing gets covered with plaster again. There are specific tools for this called wall chasers, they have a set of blades kind of like a dado set that let you cut a groove into the plaster. This would obviously be more work and much more messy than the first option. In addition to cutting the channel for the conduit, you would of course also need to chisel out holes for the boxes that would probably go through both the plaster and partially into the brick. As Harper points out, in the US, it is probably required by code to use conduit, and either way, it would be common sense to do so for protection of the cable, as well as future replacement.