4″ casings with a pitless are possible but are relatively rare. Usually, the top section will have been made 6″. This makes the installation of a pitless much easier.
If the well is 4″ diameter all the way up and with a pitless, the installation might be possible with a bit of maneuvering. If the pitless doesn’t allow installation, it can always be replaced by a slimmer kind.