Computers implement a wide range of arithmetic schemes. In some, such as decimal floating point and rational arithmetic, 0.1 + 0.2 does equal 0.3. One computer I own uses radix-100 floating point, and for it, 0.1 + 0.2 = 0.3 as well.
Now, in binary floating point arithmetic, including the ubiquitous version defined by IEEE-754 floating point standard, it is true: 0.1 + 0.2 ≠ 0.3.
Most programs these days use IEEE floating point by default. Programs can choose to implement other forms of arithmetic, including rational arithmetic and decimal floating point.