Make sure the two site collection in a same tenant and use have permission to get list data from another site collection.
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
var siteCollUrl="https://xxx.sharepoint.com/sites/lz";
var listName="CustomList";
$.ajax({
url: siteCollUrl + "/_api/web/lists/getbytitle('"+listName+"')/items",
type: "GET",
headers: {
"Accept": "application/json;odata=verbose",
},
success: function (data) {
var titles="";
$.each(data.d.results,function(i,item){
titles+="Title:"+item.Title+"\n";
});
alert(titles);
},
error: function (data) {
alert(JSON.stringify(data));
}
});
})
</script>