Could I use a front rim to build a rear wheel?
In the days before factory built wheelset, rims where produced without being specifically for front or rear wheels. On most general-use standard bicycles it is still that way. The only difference was the spoke-hole count.

But many rear wheel rims today are no longer symmetrical, meaning the right side is different from the left. This is mainly due to the fact that with 11 or even 12 speed cassettes the dish of the wheel is very unsymmetrical and the angle at which the spokes reach the rim makes the spokes puts a lot of pull on the rim. This is being countered by positioning the spoke holes differently for the drive or non-drive side.

Although 36 holes was and still is the normal count on most bicycles, you could build wheels with 32 or 28 spokes, those being mostly used on front wheels, mostly for weight saving or aerodynamics.

Nowadays many rims are specialised for their use and designed for front or rear wheels in mind, mostly for aerodynamic or load bearing abilities and often with different spoke counts. Although with the advent of disc brakes the spoke count on many front wheels is on the rise. Disc brakes put about the same stress on front wheel as the drive puts on the rear.

But if you use one of the many 'standard' rims that are still in production, you may build a rear or front wheel with any rim. 

Side-note: In the old days also front wheels would be built with thinner often double-butted spokes (1.5-1.2-1.5mm), while rear wheels had thicker (2mm) straight spokes.