There is no built-in way to check if a position is valid in Street View. However, there are some workarounds that you can use.
One workaround is to use the Google Maps API to check if a position is valid. The Google Maps API has a method called getStreetView() that takes a LatLng object as a parameter. If a position is valid, this method will return a StreetViewPanorama object. If the position is not valid, the method will return null.
Another workaround is to use the Street View Image API. The Street View Image API has a method called getPanoramaByLocation() that takes a LatLng object as a parameter. If a position is valid, this method will return a StreetViewPanoramaData object. If the position is not valid, the method will return null.
You can also use the Street View Static API to check if a position is valid. The Street View Static API has a method called getPanorama() that takes a LatLng object as a parameter. If a position is valid, this method will return a StreetViewPanorama object. If the position is not valid, the method will return null.