Well, in theory, you can. But depending on the surface and finish of the tiles you can’t always guarantee that the paint will properly adhere.
As such, without ensuring a fully smooth finish to the tiles then you could end up with streaky paint and patches of lighter and darker colours where the tiles have difference adherence levels.
Therefore, in the vast majority of cases, it is easier, quicker and less hassle to replace the tiles themselves.
However, if you love your tiles and are desperate to paint rather than replace them, then there are a few things we would recommend. Try and find paint with a bonding agent, to help it stick to the tiles, and avoid getting the tiles wet once painted, although this might be difficult in the bathroom or for a kitchen splashback!