A function that loops from i = 1 to n and then has a inner loop that goes from 1 to i would go though a number of iteration equal to this formula:
n(n+1)/2
As you can see, when we get rid of everything besides the main exponent, you end with O(n^2)
If you loop from 1 to n and then have an inside loop from 1 to n^2, then yes. You are at O(n^3) because the number of iteration you go through would be equal to:
n^3
All you care about in big O notation is the largest element in the polynomial that describes the number of iterations the code will go through. The reason for this is because everything besides the largest element quickly doesn't matter as n gets larger. And we only really care about the time requirements when n is large. So an algorithm that leads to n^3 + 5n^2 + 2n iterations would have a big O notation of O(n^3).