You're right and that 'variable' is the number of elements.
That variable is whatever you say it is. In the context of computer science it's usually the size of the input, but it could be anything as long as you make that clear. For example it's very common to express the complexity of graph algorithm in terms of two separate variables: the number of nodes and the number of edges.
Ordo notation removes any constant factor from the algorithm.
As well as constant summands, but that's not all. For example 3x^2+2x+1 is in O(x^2), so you don't just drop the constant factors and summands, you also drop any term t such that the limit of t/f(x)
is 0.
Of course the function you're trying to classify may not be a simple sum of terms at all, so the dropping-constants-and-smaller-terms approach is just a rule of thumb.