Rings that satisfy the condition
$R^n \cong R^m \iff n=m$ are said to have invariant basis number or the invariant basis property. P. M. Cohn has constructed examples of rings which fail to have this property, even giving examples of (non commutative) integral domains for which e.g. $R^3\cong R$ but $R^2\neq R$.
Suppose $R^n\cong R^m$ for some $n,m$. Then there must exist integers $h,k$ such that
$$
R^m\cong R^{m'} \iff m=m'\ \mbox{or}\ m,m'\ge h \ \mbox{and} \ m\equiv m'\ (\mod k)
$$
A ring satisfying this condition is of type $(h,k)$. In [P. M. Cohn, Some remarks on the invariant basis property, Topology 5 (1966), 215-228] a fairly simple construction is given for rings of type $(h,k)$ for any $h,k$.
There are earlier constructions of rings of type $(h,k)$ by Leavitt [W. G. Leavitt:
Modules without invariant basis number, Proc. Am. Math. Sot. 8 (1957), 322-328], [W. G. Leavitt:
The module type of a ring, Trans. Am. Math. Sot. 103 (1962), 113-130], but they are far more complicated.
Certainly we can do algebraic K-theory over rings without the invariant basis property; we just need to be a little more careful. For example we won't necessarily have $K_0(R)\cong {\bf Z} \oplus \tilde{K}_0(R)$.