It's technically illegal to have a sidecar on a bike (modification of a registered vehicle). However, you can register it with a sidecar made by the same manufacturer. Otherwise an ad-hoc sidecar (salaeng) can be registered after inspection by the motor vehicle dept. Even then you are only allowed to carry goods - not people.
Having said all that, everyone uses them and unless your involved in an accident, then the police tend to leave them alone.