It matters and it is the parallel to the beam, yes. Columns need be checked for the solicitations present and these depend on geometry, so if the results of the checks are acceptable or not.
it matters when you are designing the masonry column as the column dimensions will determine the slenderness ratios.
Design codes put limitations on slenderness ratio's and have different prescribed design parameter's for columns which fall below a certain limit vs. those that exceed this limit.
When considering the depth of a masonry column, I would consider it to be parrellel to the member supported, with the width being perpendicular. The depth would not always be the longer dimension however, depending on the geometry of the column.
The column depth, designed as an axial member, will be which ever dimension is smaller and therefore gives the smallest radius of gyration. If the column also experiences bending moments, then the depth is that which is in the direction of the moment for bending stresses and reinforcement, but is still the smaller dimension when you check axial capacity.