"Do local building codes only apply to "permanent" structures?"
There was a man in Reno, Nevada named Joe Comforte. He was in the business of providing "comfort," if you know what I mean.
His business establishment was made of three mobile homes, parked right at the junction of three counties. Whenever he heard of an 'inspection' by the 'AHJ,' his girls would roll the trailers a few feet, over the county line.
This charade finally ended, when the State formally admitted that there was no state rule against his business, and one of the counties licensed his operation.
It's rather impractical for any location to attempt to regulate the moveable.