You cannot use the same variable i for both outer and inner loop. If you use it, it can cause errors. However, I think you can use the same i for many inner loops that go in a sequence like below example because they are separate loops (you already close the other one).
For example:
for (int k = 1; k <= 5; k++) {
for (int i = 1; i <= 3; i++) {
System.out.print(i);
}
for (int i = 3; i >= 1; i--) {
System.out.print(i);
}
System.out.println();
}