Artificial perovskite-oxide nanostructures possess intriguing magnetic properties due to their tailorable electron-electron interactions, which are extremely sensitive to the oxygen coordination environment. To date, perovskite-oxide nanodots with sizes below 50 nm have rarely been reported. Furthermore, the oxygen octahedral distortion and its relation to magnetic properties in perovskite oxide nanodots remain unexplored yet. Here, we have studied the magnetic anisotropy in patterned SrRuO3 (SRO) nanodots as small as 30 nm while performing atomic-resolution electron microscopy and spectroscopy to directly visualize the constituent elements, in particular oxygen ions. We observe that the magnetic anisotropy and RuO6 octahedra distortion in SRO nanodots are both nanodots' size-dependent but remain unchanged in the first 3-unit-cell interfacial SRO monolayers regardless of the dots' size. Combined with the first principle calculations, we unravel a unique structural mechanism behind the nanodots' size-dependent magnetic anisotropy in SRO nanodots, sugguesting that the competition between lattice anisotropy and oxygen octahedral rotation mediates anisotropic exchange interactions in SRO nanodots. These findings demonstrate a new avenue towards tuning magnetic properties of correlated perovskite oxides and imply that patterned nanodots could be a promising playground for engineering emergent functional behaviors.