Code:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int foo(char ***BufferArray,char *item,int idx);
int main(){
    char **ptr=malloc(sizeof(char*)*3);
    char a[]="hello0";
    char b[]="hello1";

    foo(&ptr,a,0);
    foo(&ptr,b,1);
    printf("[%s]\n",*(ptr+0));
    printf("[%s]\n",*(ptr+1));

    free(ptr[0]);
    free(ptr[1]);
    free(ptr);
    return(0);
}
 
int foo(char ***BufferArray,char *item,int idx){
    *((*BufferArray)+idx)=malloc(sizeof(char)*(strlen(item)+1));
    strcpy(*((*BufferArray)+idx),item);
    return(0);
}
Two things.
1. You forgot to count the \0 when allocating space for the string.
2. You need to dereference BufferArray and then index it.

BufferArray points to ptr in main, and you want to effectively do ptr[idx] = malloc...

Writing it like this saves a bunch of stars and brackets.
Code:
    (*BufferArray)[idx]=malloc(sizeof(char)*(strlen(item)+1));
    strcpy((*BufferArray)[idx],item);